2 Replies Latest reply on Jun 18, 2010 11:52 PM by Shubhra Bhushan

    flex datagrid re-assign dataprovider

    gauravgr8 Level 1


      I am working on a datagrid with custom itemRenderer & [Bindable]xmllist as dataprovider. Now the changes done in xmllist are not reflected on datagrid UI until unless I re-assign the dataprovider as the same xmllist.

      As the dataprovider is Bindable so re-assigning is not required.

      But it was not working so I re-assigned the xmllist to the dataprovider of datagrid. It worked.

      Now my problem is when I re-assign the dataprovider my datagrid flicker(refreshes). It should not happen.

      1) Is there any way out to avoid re-assigning of dataprovider?

      2) Is there any way to stop flickering of datagrid on re-assigning the dataprovider?

      Thanks in advance.

        • 1. Re: flex datagrid re-assign dataprovider
          Sree_D Level 2

          When you change a value in the dataprovider itemupdated method needs to be called in order to make the change reflected. Try using some thing like below



          ICollectionView(grid.dataProvider).itemUpdated( event.item, grid.columns[event.columnIndex].dataField );


          incase you are not having event then replace it with the item you are updating in the dataprovider.

          • 2. Re: flex datagrid re-assign dataprovider
            Shubhra Bhushan

            I have tried this solution as well as ICollectionView(myRepeater.dataProvider).enableAutoUpdate();

            But they dont work at all. My scenario is that we are dynamicaly adding tags to XML file which should display in view after update is complete. If I re-assign dataProvider then the complete view reloads and it looks awful. And this does not work.

            Any help guys? Maybe someone can give sample code?