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 / March 2008

Tip: Looking for answers? Try searching our database.

Adding data to a datagrid view cell by cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mick - 04 Mar 2008 22:33 GMT
Hi,
 I am new to VB.net so at the moment I seem to be spending a lot of my time
searching for solutions to problems online. However this problem has me
stumped.

I have written a little program that as a part of it pulls information out
of a text file. What I want to do is display some of that information in a
datgridview.

I have managed to add the column headings using DataGridView1.Columns.Add,
but now I need to add data underneath these headings.

The program loops through a text file, splitting strings into smaller
strings. It is these smaller strings I want to add under the column headings.

Am I making sense? Is anyone able to help out?
Nils - 08 Mar 2008 15:48 GMT
A DataGridView is most often used to display data from a DataTable, so what
you probably want to do is create a DataSet and a DataTable, bind your
DatGridView to your DataTable and then add DataRows to your DataTable
containing the information you wish to display in the DataGridView using
DataTable.Rows.Add

Hope that helps.....

> Hi,
>   I am new to VB.net so at the moment I seem to be spending a lot of my time
[quoted text clipped - 12 lines]
>
> Am I making sense? Is anyone able to help out?
RobinS - 10 Mar 2008 07:20 GMT
> Hi,
>  I am new to VB.net so at the moment I seem to be spending a lot of my
[quoted text clipped - 14 lines]
>
> Am I making sense? Is anyone able to help out?

Why can't you just add new rows, and set the value in each cell? Is that
what you're looking for?

RobinS.

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.