views:

436

answers:

1

Using VB.NET

How to get Datagridview cell value.

I want to insert a Datagridcell value in the table, How to get datagridview cell value.

Need vb.net code Help

+2  A: 

Let's say you have an ID column called IDTextBoxColumn. You can get the value for each row like this:

For Each row As DataGridViewRow In MyDataGridView.Rows
    Console.WriteLine("ID value is " & row.Cells(IDTextBoxColumn.Index).Value.ToString())
Next
Meta-Knight