We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with hidden row when doing sorting

Thread ID:





15933 Jun 30,2004 04:06 PM UTC Jun 30,2004 04:48 PM UTC WinForms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On June 30, 2004 04:06 PM UTC

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.

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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?

Administrator [Syncfusion]
Replied On 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().

Administrator [Syncfusion]
Replied On June 30, 2004 04:48 PM UTC

thank you very much.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon