1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| // ************************************************************
private void dgvResult_RowEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0)
{
return;
}
DataRow cRow = GetDataRow(dgvResult, e.RowIndex);
txbMonTextBox.text=cRow["MaColonne"].ToString();
}
// ***********************************************************************
public static DataRow GetDataRow(DataGridView dgv, int iRow)
{
if (iRow < 0 || iRow > dgv.RowCount - 1)
{
return null;
}
DataGridViewRow dRow = dgv.Rows[iRow];
if (dRow.DataBoundItem == null)
{
return null;
}
DataRow cRow = ((DataRowView)dRow.DataBoundItem).Row;
return cRow;
} |
Partager