Collection(Of T) sortable in DataGridView

  • Thread starter Thread starter Pieter
  • Start date Start date
P

Pieter

Hi,

I made a Collection-class that inherits from
System.Collections.ObjectModel.Collection(Of T), but when I use this
collection as a DataSource of a DataGrid or a DataGridView, it isn't sorted
when the user clicks on the column-headers.

Which Interface do I have to implement for this? And how do I do this? any
sample codes? Or should I use another Collection-class to inherit from?

Thanks a lot in advance,

Pieter
 
Hi,

Pieter said:
Hi,

I made a Collection-class that inherits from
System.Collections.ObjectModel.Collection(Of T), but when I use this
collection as a DataSource of a DataGrid or a DataGridView, it isn't
sorted when the user clicks on the column-headers.

Which Interface do I have to implement for this? And how do I do this? any
sample codes? Or should I use another Collection-class to inherit from?

Have a look at generic BindingList<T>.

HTH,
Greetings
 
Thanks, it seems I must be able to find what I am looking for there.
I made a Custom Collection Class that inherited from BindingList(Of T), but
it still doesn't sort when clicking on the column-headers...
 
Back
Top