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 / Windows Forms / WinForm Data Binding / December 2004

Tip: Looking for answers? Try searching our database.

Display array data in DataGrid control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Turtle MacDermott - 28 Nov 2004 00:22 GMT
Hope this is the right newsgroup -
   if not, please redirect me.

I have an array which is created dynamically in the course of my program
execution.
Once it exists, I'd like to display its contents in a datagrid.

So far, I have succeeded in:
   Creating a dataset
   Creating a table inside that dataset
   Assigning my array data to rows in that table.
   Setting that dataset as the datasource of my datagrid
By setting some properties, and executing
   Datagrid1.expand(-1)
I've managed to get the datagrid to display a row with the title of my
table.
Clicking on this title displays the table just as my users should see it.
But it would be really great if they didn't have to click on it.
Is there any way I can get the data to display programmatically?

TIA
   - Turtle
ClayB [Syncfusion] - 28 Nov 2004 09:29 GMT
Try setting the dataGrid1.DataSource to be the datatable and not the
dataset.

======================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools

> Hope this is the right newsgroup -
>    if not, please redirect me.
[quoted text clipped - 18 lines]
> TIA
>    - Turtle
Sijin Joseph - 29 Nov 2004 06:13 GMT
If you just want to display the data then no need to use a dataset at
all, just set the datagrids DataSource property to your array or arrayList.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> Hope this is the right newsgroup -
>     if not, please redirect me.
[quoted text clipped - 18 lines]
> TIA
>     - Turtle
Turtle MacDermott - 02 Dec 2004 19:50 GMT
Many thanks to both of you for your suggestions.

I wasn't able to get the array itself bound to the datagrid
(the data grid would show up with a big red X across it), but using just the
table worked great!!!

   - Turtle

> Hope this is the right newsgroup -
>     if not, please redirect me.
[quoted text clipped - 18 lines]
> TIA
>     - Turtle

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.