0 Replies Latest reply on Mar 1, 2010 6:53 AM by SIEKAR

    Cannot expand an item in AdvancedDataGrid Programatically

    SIEKAR

      I am currently using an advanceddatagrid to display a list of documents that are Grouped by Document Name and I would like to expand  an item of this advanced datagrid programatically to select a document. For the moment my code for the performing the above mentioned task looks like:

          

       

       

      var openNodes:Object = IHierarchicalCollectionView(grid.dataProvider).openNodes;

       

           for each (var item:Object in openNodes){

                grid.selectedIndex++;

      // Select First Document

       

       

                for each(var doc:Document in item.children){

       

                     if(doc != selectedDocument)

                          grid.selectedIndex++;

      //Move Selected Index

       

       

                     else

       

       

                          break;

                }

           }

       

       

      This code has some error as it does not point to the correct document sometimes.. Can anyone suggest a better way to accomplish the same. I tried using expandItem and expandChildrenof methods in the Advandceddatagrid but it does not work. Even after giving a grid.validate() call to refresh the control the above two methods cannot expand the node I need.. Any help would be appreciated.

       

      Thanks,