First hello to all.
I have the following code in the cellmouse event to get information from a selected row.
but when i select a collumn, i recive an error because i'm selecting a cell with the mouse and i dont have code for that selection. My question is how can i put an "if" on the beguining of the event so that he can determine if it's a header or not.
Thanks too all in advance.. Any help is welcome.
I have the following code in the cellmouse event to get information from a selected row.
Code:
private void dt_Grid_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
datagrid.Rows[0][0] = dt_Grid.Rows[e.RowIndex].Cells[0].Value.ToString();
datagrid.Rows[0][1] = dt_Grid.Rows[e.RowIndex].Cells[1].Value.ToString();
datagrid.Rows[0][2] = dt_Grid.Rows[e.RowIndex].Cells[2].Value.ToString();
datagrid.Rows[0][3] = dt_Grid.Rows[e.RowIndex].Cells[3].Value.ToString();
datagrid.Rows[0][4] = dt_Grid.Rows[e.RowIndex].Cells[4].Value.ToString();
datagrid.Rows[0][5] = dt_Grid.Rows[e.RowIndex].Cells[5].Value.ToString();
datagrid.Rows[0][6] = dt_Grid.Rows[e.RowIndex].Cells[6].Value.ToString();
datagrid.Rows[0][7] = dt_Grid.Rows[e.RowIndex].Cells[7].Value.ToString();
datagrid.Rows[0][8] = dt_Grid.Rows[e.RowIndex].Cells[8].Value.ToString();
}
Thanks too all in advance.. Any help is welcome.
Comment