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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Maintaining sort order on refresh.

Thread ID:

Created:

Updated:

Platform:

Replies:

30505 Jun 19,2005 10:26 PM UTC Jun 20,2005 06:15 PM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 19, 2005 10:26 PM UTC

Hi, I am using GridDataBoundGrid ver 2.1.0.9. I have a number of columns in my grid which are ''sortable''. Right now, if underlying DataSource (which is DataTable) is refreshed , grid is sorted by default column (which is the first column) instead of being sorted by column which was the ''sort'' column before refresh. If custom programming is required to achieve what i am trying to do, then how do i keep track of current column that is being used for sorting ? I guess, i can override SortbyColumn method and save colIndex argument .. is there is a more direct approach avaialable ? thanks

Administrator [Syncfusion]
Replied On June 20, 2005 08:49 AM UTC

You can save the Sort property on teh DataView associated with the datasource before you refresh, an dthen reset this property after you refresh. CurrencyManager cm = this.grid.BindingContext[this.grid.DataSource, this.grid.Daatmember] as CurrencyManager; DataView dv = cm.List as DataView; string saveSort = dv.Sort; // do your refresh dv.Sort = saveSort;

Administrator [Syncfusion]
Replied On June 20, 2005 06:15 PM UTC

thanks !!! this will help ... >You can save the Sort property on teh DataView associated with the datasource before you refresh, an dthen reset this property after you refresh. > >CurrencyManager cm = this.grid.BindingContext[this.grid.DataSource, this.grid.Daatmember] as CurrencyManager; >DataView dv = cm.List as DataView; >string saveSort = dv.Sort; > >// do your refresh > >dv.Sort = saveSort; > >

CONFIRMATION

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.

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

;