-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Sudhakar Sadasivuni{MVP}
Message 3 in Discussion

The only way to save the sort state of a column is to store each columns last sort 
order in View state. This is basically enables us to do bidirectional sort.   The 
sorting order per each column can be switched on click.   check this for more details  
 http://www.aspalliance.com/articleViewer.aspx?aId=4&vId=&pId=   and one more 
thing..we should not re-fill the data set every time for column sorting. Instead we 
could use a dataview and make use of it for offline sorting in that.   e.g :     
private void reportDataGrid_SortCommand(object source, 
System.Web.UI.WebControls.DataGridSortCommandEventArgs e) 
{ 
reportDataGrid.CurrentPageIndex = 0; 
ViewState["SortExpressionValue"] = e.SortExpression; 
SortReport(e.SortExpression); 
} 
  
private void SortReport(string columnName) 
{  
DataView dv = ds.Tables[0].DefaultView; 
dv.Sort = columnName + " ASC"; 
reportDataGrid.DataSource = dv; 
reportDataGrid.DataBind(); 
} 
  
HTH 
Sudhakar
Microsoft .NET MVP | MCAD
http://weblogs.asp.net/ssadasivuni


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to