Selecting entire row in DataGrid

B

Bachus

Hello,
Is there any way to disable highlight on selected cell in DataGrid ?
I want to select entire rows and only rows in my DataGrid.
DataGrid is readonly.
I put that into my code :

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

This selects entire row, but current cell is highlited. i want to get rid of
that highlight.
What should i do ? Is it possible to do that by changing some properties ?

Adam
 
G

Guest

When I select the row from the MouseUp handler, I don't have a highlight on
the cell:

private void dgrMain_MouseUp(object sender,

System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hit = dgrMain.HitTest(e.X, e.Y);
if (hit.Type == DataGrid.HitTestType.Cell) dgrMain.Select(hit.Row);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top