Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEWBIE !! - Value from Datagridview

Status
Not open for further replies.

Skarcrow

Programmer
Feb 2, 2005
13
GB
This seems simple but is driving me mad. :(

I have a datagridview which is populated from a bindingsource pointing to a DBF file on our server. I have successfully popuplated the grid with the data and what I want now is to get the value of one of the fields in the currently selected row in the datagridview.

Hope I have used the correct terminology.
 
DataGridView1.Item(ColumnNumber, DataGridView1.CurrentRow)

DataGridView1.CurrentRow get the currently selected row in the DataGridView1.

ColumnNumber is a variable containing the number of the column with the data you want.

BTW, I got all of this from a Google search for "msdn datagridview".

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thanks for the feedback.

Looking through the VS Help File I did find

DatagridView Enter New Row Event
DataGridView.Rows(e.RowIndex).Cells.Item(ColumnNumber).Value

Thanks Again :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top