vb.net datadrig view get each cell value

Posted by Gbolahan on Stack Overflow See other posts from Stack Overflow or by Gbolahan
Published on 2010-06-10T11:48:26Z Indexed on 2010/06/10 11:52 UTC
Read the original article Hit count: 135

Filed under:

hello i'm trying to get the first value of a datagrid cell value but it keeps looping trough and returns the last value. here is the code:

Dim cell As DataGridViewCell txtoccupier.Text = "" Try For Each cell In dgvREcord.CurrentRow.Cells() txtoccupier.Text = cell.Value.ToString Next Catch ex As Exception MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Try End Try

record eample: id name email


1 test [email protected]

it returns only [email protected] but i want to get only the id which is 1

thanks for your help

© Stack Overflow or respective owner

Related posts about vb.net