473,385 Members | 1,766 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,385 software developers and data experts.

Reading an Unbound DataGridView Control with VB 2005

Hello, I have a DataGridView control in VB.NET 2005 that I would like to
iterate thru row by row and parse out the individual columns into variables.
Can someone provide me example code or direct me to a document that shows
how this can be done?

Thank you
Dec 7 '05 #1
4 10211
dm1608 wrote:
Hello, I have a DataGridView control in VB.NET 2005 that I would like to
iterate thru row by row and parse out the individual columns into variables.
Can someone provide me example code or direct me to a document that shows
how this can be done?

Thank you


I believe this is right, I'm doing it from memory w/o VB.

For ii = 0 to DataGridView.Rows.Count -1
for ix = 0 to DataGridView.Columns.Count
debug.Writeline(DataGridView.Rows(ii)(ix).ToString )
next
End
Dec 7 '05 #2
That's cool... thanks!

Another question... do you know how I can clear the DataGridView so I can
reload?

I guess I have two possible requirements:

1) Delete all rows
2) Delete all rows and column headers so I can add new one and change text,
etc.

Thanks again!

"I Don't Like Spam" <no@spam.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
dm1608 wrote:
Hello, I have a DataGridView control in VB.NET 2005 that I would like to
iterate thru row by row and parse out the individual columns into
variables. Can someone provide me example code or direct me to a document
that shows how this can be done?

Thank you


I believe this is right, I'm doing it from memory w/o VB.

For ii = 0 to DataGridView.Rows.Count -1
for ix = 0 to DataGridView.Columns.Count
debug.Writeline(DataGridView.Rows(ii)(ix).ToString )
next
End

Dec 8 '05 #3
Does anyone know how to make the DataGridView so I can select a column and
copy it to my clipboard? It looks like I have the sorting enabled, so it
doesn't highlight the columns???

Also, assuming I want to create just a button to copy a particle column to
the clipboard, what is the code for this?

"I Don't Like Spam" <no@spam.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
dm1608 wrote:
Hello, I have a DataGridView control in VB.NET 2005 that I would like to
iterate thru row by row and parse out the individual columns into
variables. Can someone provide me example code or direct me to a document
that shows how this can be done?

Thank you


I believe this is right, I'm doing it from memory w/o VB.

For ii = 0 to DataGridView.Rows.Count -1
for ix = 0 to DataGridView.Columns.Count
debug.Writeline(DataGridView.Rows(ii)(ix).ToString )
next
End

Dec 8 '05 #4
DM,

You should forever try to avoid with windowforms datacontrols to access the
control direct.

Use the underlying datasource (datatable, dataview, etc).

Cor
Dec 8 '05 #5

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

Similar topics

1
by: dm1608 | last post by:
Can someone give me some examples of setting the column names and loading rows into a DataGridView control manually. I need to read a directory and create various output messages based on the...
7
by: Max | last post by:
I've included the needed tables in the DataSource. Those tables that are bound to controls I can workwith. But how do you get access to the DataAdaptors that are not bound? me.Dataset1.table...
3
by: Aspnot | last post by:
I have a form that is setup in a Master/Detail configuration. The Detail section is represented with a DataGridView. Some of the columns in this DataGridView control are unbound. When a user...
7
by: Rainer Queck | last post by:
Hi NG, Why is it, that in my DataGridView all columns which are not bound to a "DataProperty" loos thier content in a couple of occasions? This happens if: - Underlaying...
1
by: Martin | last post by:
Hi, I'm having a problem with a datagridview control when trying to read the value of an unbound checkbox cell. The code below works fine if I click on any text cell, bound or unbound, and...
1
by: kevinlkingma | last post by:
Hi All: Can someone tell me how to programatically move to a specific row in an unbound datagridview control (and move the cursor on to that row)? Kevin
2
by: =?Utf-8?B?QnJhZA==?= | last post by:
ok, vs2005 and vb.net i have an unbound datagridview control i am programatically adding data to it the DataGridView.Rows.Add() function does not always add rows to the end of the grid...
1
by: Karl | last post by:
Hi all... This is a good one. You'll like this... I am working on a course management tool that allows certain Courses to be cross referenced with Job Roles and, when they are, whether the...
0
by: Ed Bitzer | last post by:
Appreciate some direction on populating an unbound DataGridView with an one dimensional array of date an appointments (a calendar) read from a coma delimited text file. My original approach was to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.