Presenting run-time generated data in sortable datagrid?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My application needs to present data generated at run time in a datagrid that
can be sorted by clicking on columns, and where rows can be selected and
events generated.

Do I need to set up a dataset and datatable to do this or can I do this
through arrays (which I believe can not be sorted in a datagrid)?

Can anyone point me towards any samples or in the right direction?

thanks much - Jon
 
Jon,
Using a DataSet & DataTable is easier...

However! if you put your data in a collection that implements IBindingList
such as:

Public Class Data
End Class

Public Class DataCollection
Inherits CollectionBase
Implements System.ComponentModel.IBindingList

...

End Class

You can bind an instance of DataCollection to your DataGrid and it will be
sortable.

Rockford Lhotka's book "Expert One-On-One Visual Basic .NET Business
Objects" from A! Press, provides demonstrates how to implement IBindingList.
http://www.lhotka.net

Post if you would like other samples.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top