Jump to content
Xtreme .Net Talk

How to get DataGrid Field value for Selected Row?


Recommended Posts

Guest cgchris99
Posted

I have a Datagrid that is from a table.

When I highlight the row, and click my select button, how do I know what the value of a certain column is?

 

Thanks for any advice

  • Moderators
Posted

You can do this for column number....

MessageBox.Show(myGrid1.CurrentCell.ColumnNumber.ToString)

 

Row number...

MessageBox.Show(myGrid1.CurrentCell.RowNumber.ToString)

 

Both row and column (as string)

MessageBox.Show(myGrid1.CurrentCell.ToString)

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...