I set this.gridDataBoundGrid1.DataSource = Source, where Source is defined as List and is an object list contains information such 'UserID', 'FullName' etc. After I doing this, the grid can be built up normally with correct information. However, the "this.gridDataBoundGrid1.SortBehavior = Syncfusion.Windows.Forms.Grid.GridSortBehavior.DoubleClick" is not working any more.
Could anybody tell me why and how I can sort it out? Thanks.
JJ
Jisha Joy
Syncfusion Team
July 22, 2008 11:59 AM UTC
Hi Preston,
By default sorting is done in a GridDataBoundGrid through the IBindingList.Sort method on the underlying datasource for the grid. This means that the sorting is done on the actual values that are in the datasource (and not the foreign key value which ,is gotten from another datasource). If the dataSource is a DataTable, then this means that the sort is effectively being done by setting the DataView.Sort property on the dataTable.DefaultView.
If your DataGrid is bound to some IList collection and you want your DataGrid to support sorting , you will have to implement the IBindingList.AllowSorting property and the IBindingList.ApplySort method (in addition to the other interface members).
Let me know if you need further assitance.
Regrads,
Jisha
AD
Administrator
Syncfusion Team
October 27, 2008 09:26 AM UTC
Can you explain this a bit further. I have a gridDataBoundGrid which is bound to a BindingList. I need to be able to sort!
>Hi Preston,
By default sorting is done in a GridDataBoundGrid through the IBindingList.Sort method on the underlying datasource for the grid. This means that the sorting is done on the actual values that are in the datasource (and not the foreign key value which ,is gotten from another datasource). If the dataSource is a DataTable, then this means that the sort is effectively being done by setting the DataView.Sort property on the dataTable.DefaultView.
If your DataGrid is bound to some IList collection and you want your DataGrid to support sorting , you will have to implement the IBindingList.AllowSorting property and the IBindingList.ApplySort method (in addition to the other interface members).
Let me know if you need further assitance.
Regrads,
Jisha
HL
Hyung-Jin Lee
November 14, 2008 06:03 AM UTC
Hello.
Thank you for asking the same qustion that I want to ask, and show us good answers and sample.
But I didn't still make it yet. . .. T_T
In my case, I use BindingList <> as DataSource of GridDataBoundGrid,
but BindingList doen't have Sort()
and similar methord .
Do I have to use only ArraryList ?
If you have another solution, Please
help me.
Thank you