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!

Reading Cell data from a windows.form Datagrid

Status
Not open for further replies.

jfoster42

Programmer
Dec 9, 2002
1
US
Hello,

I'm trying to read cell info from a datagrid. I tried linking through the datagrid to the table that its bound to such as:

MessageBox.Show(myDataTable.Rows[myDataGrid.CurrentRowIndex]["ColumnName"].ToString());

that works... until you resort the columns, then the datatable doesn't match anymore.

Any ideas?

Thanks
Jeff Foster
 
Have you tried this?

yourDG[yourDG.CurrentRowIndex,"ColumnName"].ToString()

I hope this help you,

(-: Ernesto .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top