I have a grid control in my project, and hide some rows, when I sort the column, the hidden rows reappeared. How can I prevent the hidden rows from appearing again? Is this a bug?
in the derived grid control.
ADAdministrator Syncfusion Team June 30, 2004 11:24 AM
You will have to handle this yourself. The grid does not try to manage this for you.
A couple of ways you could do this. One is to move all teh hidden rows to the top. Then you can use the overload of SortByCol that accepts 3 arguments, the last one being extra header argument that you can set to avoid these rows being affected by the sort.
Another technique might be to loop through the rows before the sort an dset a flag in grid[row,1].Tag that marks whether teh row is hidden. Then after the sort, you can loop through again and test for this flag to make sure teh right rows are visible or not.
ADAdministrator Syncfusion Team June 30, 2004 11:31 AM
I already going down the second method that you suggested. I see flickering when I am resetting the row state. Is there a method in the grid to suspend the redraw before sorting and setting the visible state, and than resume the redraw?
ADAdministrator Syncfusion Team June 30, 2004 11:45 AM
Before sorting, call grid.BeginUpdate() and then later call grid.EndUpdate(). If the grid does not redraw itself, try calling grid.Refresh().
ADAdministrator Syncfusion Team June 30, 2004 11:48 AM