Pages
Home
Contact Me
Thursday, June 4, 2009
Get the index of the SelectedRow in a DataGridView
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
if (dataGridView1.SelectedRows.Count == 1)
{
txttextbox1.Text = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells["CustCode"].Value.ToString();
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment