Hello!
The second problem is that e.RowIndex1 can be negative even when the e.CellValue1 contains a good value.
So, how should I sort the grid by underlying data using my custom logic?
Thank you.
I have a problem with custom sorting in the latest WinForms RadGridView (2010.2.10.806). It worked well with version 2009.3.9.1203. I use Visual Studio 2008 with .NET 3.5.
The code snippet is very simple:
01.foreach (GridViewDataColumn column in grid.Columns) 02. column.CustomDataOperation = CustomDataOperation.Sorting; 03.... 04. 05.void grid_CustomSorting(object sender, GridViewCustomSortingEventArgs e) 06.{ 07. MyItem item1 = grid.Rows[e.RowIndex1].DataBoundItem as MyItem; 08. MyItem item2 = grid.Rows[e.RowIndex2].DataBoundItem as MyItem; 09. ... 10.} When the grid column header is clicked, the System.StackOverflowException occurs in grid_CustomSorting at the point where e.RowIndex1 or e.RowIndex2 is accessed. Moreover, it occurs even if we have
1.void grid_CustomSorting(object sender, GridViewCustomSortingEventArgs e) 2.{ 3. int ind1 = e.RowIndex1; 4.} The second problem is that e.RowIndex1 can be negative even when the e.CellValue1 contains a good value.
So, how should I sort the grid by underlying data using my custom logic?
Thank you.