DataGrid - Click anywhere and act like you clicked to the far left.
-
Is there any way to click somewhere in the datagrid, but have it highlight the entire row like it would if you clicked the row on the far left outside all the cells? I can get it to highlight the entire row, but it also highlights the text inside the cell i clicked on. I guess I'm answering my own question in a way. Now I need to find out how to make the cell text not highlight. =)
-
Is there any way to click somewhere in the datagrid, but have it highlight the entire row like it would if you clicked the row on the far left outside all the cells? I can get it to highlight the entire row, but it also highlights the text inside the cell i clicked on. I guess I'm answering my own question in a way. Now I need to find out how to make the cell text not highlight. =)
Override OnMouseDown etc. protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); //selecting row this.Select(this.CurrentRowIndex); //hilighting the cell DataGrid.HitTestInfo hi=this.HitTest(e.X,e.Y); if(e.Button==MouseButtons.Left && hi.Type==DataGrid.HitTestType.Cell && hi.Row>=0) { ... } } Hi, AW