Access to Rows in a datagrid

R

Robin Bonin

I am working on a page to allow editing of products in out database. I'd
like to bind a datareader to the table. And on submit generate an update
query for each row. My problem is that I can't find out how to iterate
through all the rows in the dataGrid

I don't want to use the built in edit mode available because there are going
to be allot of small changes and would be time consuming to hit edit for
each row.



I'm hoping that I can do something like this



For each row in datagrid

value1 = row.textBox1.value

value2 = row.textBox2.value

' sql work

Next
 
J

Jon Sequeira

Sounds like you want the DataGridItem object.

For Each item as DataGridItem in gridMain.Items
' do stuff
Next

HTH,

--Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,083
Messages
2,570,591
Members
47,212
Latest member
RobynWiley

Latest Threads

Top