2 Replies Latest reply on May 15, 2007 12:12 PM by mFlexDev

    DataGrid rendering issue during runtime

    mFlexDev Level 1

      I have a data grid where the data during runtime changes.Basically I use a tree structure in the first column of the data grid where the top level rows will be displayed in the beginning . Let's say at the beginning I have 2 rows and When the user expands the 2nd row I fetch some more data and display it on the Datagrid Again with the 2nd row expanded . One approach is to reinitialise the Dataprovider and refresh the datagrid again .But I feel this is not the right Approach .Is it possible to render the results only to the existing Datagrid.

      I have a custom item renderer to render the tree structure for the first column.If I have the full XML in the beginning then it works fine .But do not know if I can optimize it without reloading the whole XML again.
        • 1. Re: DataGrid rendering issue during runtime
          ashar2005 Level 1
          I'm assuming you have the ArrayCollection set as [Bindable] that is used for your datagrid's dataProvider.

          Try using: yourDataGrid.validateNow() and yourDataGrid.validateDisplayList()
          after you fetch new data into the ArrayCollection.
          • 2. Re: DataGrid rendering issue during runtime
            mFlexDev Level 1
            I was looking into the Datagrid class and got to know that the Dataproviders are associated with Change event .so I do not really need to do anything If I am using the collection classes as dataprovider.I also tested the same and it's working perfectly.I'm not sure what will be the performance impact when I have huge data .I guess it must have been implemented keeping the performance issues in mind.