Binding custom objects to Data Grids

Binding collections of custom objects to the DataGrid control works great, but I need a little bit more control.  

1) By default all the public properties on the objects become visible columns in the grid, and the header is the name of the property - How can I control what gets displayed, should ICustomTypeDescriptor interface be used

2) How can I implement sorting and searching on the custom object list bound to the grid - Would implementing IBindingList do the trick

Has anybody else tried this, or can anybody maybe point me to some examples that show how to solve the problems above, or is that just the limitation of binding custom objects to the DataGrid

Thank you in advance.


Answer this question

Binding custom objects to Data Grids

  • Min Wang

    ...and yes, implement IBindingList to allow sorting and searching.
  • Saric Sead

    From GotDotNet: <a href="http://www.gotdotnet.com/community/messageboard/Thread.aspx id=19446">Formatting Collections in DataGrids</a>
  • Binding custom objects to Data Grids