Highlighting the clicked row in the datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Is it possible to highlight the clicked row in a datagrid? How to do it

Thanks in advance.
 
Kshitij said:
Hi,

Is it possible to highlight the clicked row in a datagrid? How to do it?

Thanks in advance.

One way is to call select it when a cell is clicked or the current cell
is changed as in the following snippet:

private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
{
dataGrid1.Select(dataGrid1.CurrentCell.RowNumber);
}

HTH,
APG
 
Back
Top