473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Presenting run-time generated data in sortable datagrid?

Jon
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
Nov 21 '05 #1
2 1369
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/archi.../16/43679.aspx

- Scott Swigart
blog - http://ea.3leaf.com
"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
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

Nov 21 '05 #2
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

"Jon" <Jo*@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
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

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: leroybt.rm | last post by:
Can someone tell me how to run a script from a interactive shell I type the following: >>>python filename >>>python filename.py >>>run filename >>>run filename.py >>>/run filename >>>/run...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
5
by: Patrice FRITSCH | last post by:
I'm trying to run a batch file from an asp page using WScript.Shell object. Dim oWSH set oWSH= Server.CreateObject("WScript.Shell") call oWSH.Run("cmd.exe /c " & szCmd , 0, true) szCmd...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
4
by: trichert | last post by:
Ok , developing a .aspx page with Visual Web Studio (the full page is at the bottom). Basically its a page that displays all my computers and the current logged on user pulling data from a live...
9
by: Brett Wesoloski | last post by:
I am new to VS2005. I changed my program.cs file to be a different form I am working on. But when I go to run the application it still brings up the form that was originally declared as new. ...
8
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? --...
3
by: Nick Wedd | last post by:
Maybe this isn't really a PHP problem. But it's possible that PHP has a good solution for it. I have a php page which collects some input from the user, constructs an image, and then displays...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.