2 Replies Latest reply on Jul 2, 2010 12:14 PM by =VA=FyreHeart

    Hide rows in  a advanced DataGrid

    YKaura

      Hi,


      I have a requirement to hide rows in a datagrid.

      The requirement is this

      there are two grids

      hierarchical

      flat

       

      On the click of data in hierarchical datagrid the flat datagrid needs to be populated with all its children

      In the hierarchical datagrid some children can be visible and some not.So,those rows need to be hidden.

       

      However, on the click of an element ALL its children need to be visible in the flat table.

       

      As such I cannot filter the dataProvider.

       

      Please suggest what should be done.The hierarchichal DataGrid uses XMLListCollection.

       

      Thanks

      Yukti.

        • 1. Re: Hide rows in  a advanced DataGrid
          rootsounds Level 4

          Create a custom class to perform the filtering work on the data that you need. Expose a bindable property for the data provider of each grid.

           

          To restrict the number of children, you can loop through an manually remove them.

          • 2. Re: Hide rows in  a advanced DataGrid
            =VA=FyreHeart Level 2

            It seems to me some creative use of GroupingFields and SummaryRows might work. I assume this is for a "drill-down" kind of grid, where users can click twisty arrows for a little more detail, or click the actual entry for a LOT more detail.

             

            If you populate your hierarchical datagrid with your summary data, and make the final level in the hierarchy a callback to a function that creates your flat datagrid, that could work. It's labor intensive, but theoretically possible.

             

            I've had to do something similar. For my system, I set up the heirarchical datagrid in an ADG with my Summary Rows as above, and create an invisible GROUP or CANVAS for the detailed dataGrid. When a user clicks on a cell, I use the itemClick event to fire off a second HTTPService request to get the detailed data, populate the GROUP/CANVAS, and then make it visible.

             

            I'd recommend splitting your data source into multiple HTTPRequest (or equivalent) calls. Unless your dataset is reasonably small, loading the entire dataset into the grid at once will really slow down scrolling and other interactions.

            1 person found this helpful