Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / October 2004

Tip: Looking for answers? Try searching our database.

Presenting run-time generated data in sortable datagrid?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jon - 29 Oct 2004 20:38 GMT
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
Scott Swigart - 29 Oct 2004 20:49 GMT
You have to put the data in a DataTable.  Here's a blog post on gen'ing up a
DataTable from scratch:

http://weblogs.asp.net/dneimke/archive/2003/12/16/43679.aspx

- Scott Swigart
blog - http://ea.3leaf.com

> My application needs to present data generated at run time in a datagrid
> that
[quoted text clipped - 7 lines]
>
> thanks much - Jon
Jay B. Harlow [MVP - Outlook] - 30 Oct 2004 17:01 GMT
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

> My application needs to present data generated at run time in a datagrid
> that
[quoted text clipped - 7 lines]
>
> thanks much - Jon

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.