G
Guest
Hi,
I'm trying to create a collection class that I can bind to DataGrids (In
particular, we use the C1.TrueDBGrid from Component One)
I'm inheriting ArrayList and implementing IBindingList & ITypedList. I'm
pretty much there, data binding is fine & the underlying objects in the
collection are being updated by the grid - where I'm struggling is with the
sorting functionality. At the moment, the column I am clicking on is being
sorted but nothing else in the grid is!
Also, when I click on the column header again to switch the sort direction
it does not immediately apply, I have to move off the column then back again
to be able to change sort direction.
What I want is my collection to behave like a DataTable\View. All data in
the grid should of course be sorted to reflect the column being sorted.
DataTable sorting also applies additional sorting, eg; my grid exposes
columns Qty1, Qty2, Qty3. If I chose to sort by Qty1 it would sort primarily
by that column, then by Qty2, then by Qty3 etc. I guess that DataTable
achieves this by using the DataColumnCollection to determine columns to sort
by? I would need something similar for my collection to be able work out
which addition fields to sort by?
I've found various articles on DataBinding collections, sorting collections
- but can anyone point me towards articles \ examples addressing these
described issues?
Thanks
I'm trying to create a collection class that I can bind to DataGrids (In
particular, we use the C1.TrueDBGrid from Component One)
I'm inheriting ArrayList and implementing IBindingList & ITypedList. I'm
pretty much there, data binding is fine & the underlying objects in the
collection are being updated by the grid - where I'm struggling is with the
sorting functionality. At the moment, the column I am clicking on is being
sorted but nothing else in the grid is!
Also, when I click on the column header again to switch the sort direction
it does not immediately apply, I have to move off the column then back again
to be able to change sort direction.
What I want is my collection to behave like a DataTable\View. All data in
the grid should of course be sorted to reflect the column being sorted.
DataTable sorting also applies additional sorting, eg; my grid exposes
columns Qty1, Qty2, Qty3. If I chose to sort by Qty1 it would sort primarily
by that column, then by Qty2, then by Qty3 etc. I guess that DataTable
achieves this by using the DataColumnCollection to determine columns to sort
by? I would need something similar for my collection to be able work out
which addition fields to sort by?
I've found various articles on DataBinding collections, sorting collections
- but can anyone point me towards articles \ examples addressing these
described issues?
Thanks