2 Replies Latest reply on Jun 10, 2010 11:26 PM by BhaskerChari

    double click problem?

    flex_kkm

      Double click event is not working for Datagrid? How can i solve it?

        • 1. Re: double click problem?
          BhaskerChari Level 4

          Hi flex_kkm,

           

          You need to fisrt enable doubleClickEnabled="true" on DataGrid. Check the below sample:

           

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
            <![CDATA[
             import mx.controls.Alert;
            ]]>
          </mx:Script>
          <mx:ArrayCollection id="arr1" >
            <mx:Object>
             <mx:col1> test1 </mx:col1>
             <mx:col2> price1 </mx:col2>
             <mx:col3> album1 </mx:col3>
            </mx:Object>
            <mx:Object>
             <mx:col1> test2 </mx:col1>
             <mx:col2> price2 </mx:col2>
             <mx:col3> album2 </mx:col3>
            </mx:Object>
          </mx:ArrayCollection>
          <mx:DataGrid x="23" y="10" dataProvider="{arr1}" doubleClickEnabled="true" doubleClick="Alert.show('Double Click Fired');">
            <mx:columns>
            <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
            <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
            <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
          </mx:DataGrid>
          </mx:Application>

          If this post answers your question or helps, please kindly mark it as such.


          Thanks,

          Bhasker Chari

          • 2. Re: double click problem?
            flex_kkm Level 1

            Thanks dude. The answer is very helpful.