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?
I call
this.Data.SortByColumn(col,(ListSortDirection)this[0, col].Tag);
in the derived grid control.
AD
Administrator
Syncfusion Team
June 30, 2004 04:24 PM UTC
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.
AD
Administrator
Syncfusion Team
June 30, 2004 04:31 PM UTC
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?
AD
Administrator
Syncfusion Team
June 30, 2004 04:45 PM UTC
Before sorting, call grid.BeginUpdate() and then later call grid.EndUpdate(). If the grid does not redraw itself, try calling grid.Refresh().
AD
Administrator
Syncfusion Team
June 30, 2004 04:48 PM UTC
thank you very much.