1 Reply Latest reply on May 22, 2009 2:20 PM by Michael Borbor

    data grid - unselecting

    Bob in SC Level 1

      basic question - i have a datagrid. I can select a row (or multiples) but i can never unselect all rows...thus leaving nothing highlighted. How do you achive this?

        • 1. Re: data grid - unselecting
          Michael Borbor Level 4
          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
               <mx:Script>
                    <![CDATA[
                         import mx.collections.ArrayCollection;
                         [Bindable]
               public var expenses:ArrayCollection = new ArrayCollection([
                  {Month:"Jan", Profit:2000, Expenses:120, Amount:45},
                  {Month:"Feb", Profit:1000, Expenses:200, Amount:60},
                  {Month:"Mar", Profit:1500, Expenses:500, Amount:30}
               ]);
               
               private var myDummyArray:Array=new Array();
          
                    ]]>
               </mx:Script>
               <mx:DataGrid id="myDG" dataProvider="{expenses}" allowMultipleSelection="true" />
               <mx:Button click="myDG.selectedItems=myDummyArray" />
          </mx:Application>