Re: Custom Sorting a DataTable Using DataGrid
From: ClayB [Syncfusion] (clayb_at_syncfusion.com)
Date: 08/19/04
- Previous message: ClayB [Syncfusion]: "Re: Detecting a new Datagrid Row"
- In reply to: ClayB [Syncfusion]: "Re: Custom Sorting a DataTable Using DataGrid"
- Next in thread: Dean Rettig: "Re: Custom Sorting a DataTable Using DataGrid"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Aug 2004 04:36:51 -0400
I think the code in the previous post does work to sort according to string
length, but the sample data generated does not illustrate this well since
the length sorting for the generated data is the same as the default
sorting. If you use this loop to generate the sample data, then two sorts
give different results and thus better illustrate the idea.
=========================
Clay Burch, .NET MVP
Visit www.syncfusion.com for the coolest tools
for(int i = 0; i < nRows; ++i)
{
DataRow dr = dt.NewRow();
for(int j = 0; j < nCols; j++)
if(i % 2 == 0)
dr[j] = new MyObject("row" + new string('a', 1 + r.Next(10)));
else
dr[j] = new MyObject("a" + new string('a', 1 + r.Next(10)));
dt.Rows.Add(dr);
}
- Previous message: ClayB [Syncfusion]: "Re: Detecting a new Datagrid Row"
- In reply to: ClayB [Syncfusion]: "Re: Custom Sorting a DataTable Using DataGrid"
- Next in thread: Dean Rettig: "Re: Custom Sorting a DataTable Using DataGrid"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|