Allowing multiple file selection on an FileSystemDataGrid control in Adobe AIR

by Peter deHaan on December 21, 2008 · 0 comments

in FileSystemDataGrid

The following example shows how you can enable multiple file selection in an Adobe AIR FileSystemDataGrid control by setting the Boolean allowMultipleSelection property.

Full code after the jump.

<?xml version="1.0" encoding="utf-8"?>
<!-- http://airexamples.com/2008/12/21/allowing-multiple-file-selection-on-an-filesystemdatagrid-control-in-adobe-air/ -->
<mx:WindowedApplication name="FileSystemDataGrid_allowMultipleSelection_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        showStatusBar="false"
        width="1020"
        height="720">
 
    <mx:ApplicationControlBar dock="true">
        <mx:Form styleName="plain">
            <mx:FormItem label="allowMultipleSelection:">
                <mx:CheckBox id="checkBox" selected="true" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>
 
    <mx:Form width="100%" height="100%">
        <mx:FormItem label="FileSystemDataGrid:"
                width="100%"
                height="100%">
            <mx:FileSystemDataGrid id="dataGrid"
                    allowMultipleSelection="{checkBox.selected}"
                    width="100%"
                    height="100%" />
        </mx:FormItem>
        <mx:FormItem label="selectedIndices:" width="100%">
            <mx:List dataProvider="{dataGrid.selectedIndices}"
                    width="100%"
                    rowCount="3" />
        </mx:FormItem>
        <mx:FormItem label="selectedItems:" width="100%">
            <mx:DataGrid dataProvider="{dataGrid.selectedItems}"
                    width="100%"
                    rowCount="3"
                    itemRenderer="mx.controls.Label" />
        </mx:FormItem>
        <mx:FormItem label="selectedPaths:" width="100%">
            <mx:List dataProvider="{dataGrid.selectedPaths}"
                    width="100%"
                    rowCount="3" />
        </mx:FormItem>
    </mx:Form>
 
</mx:WindowedApplication>

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post:

Next post: