1.在datagrid上点击时高亮显示整行。
Code
private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hti = dataGrid1.HitTest(e.X, e.Y);
if(hti.Type == DataGrid.HitTestType.Cell)
{
dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dataGrid1.Select(hti.Row);
}
}
private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hti = dataGrid1.HitTest(e.X, e.Y);
if(hti.Type == DataGrid.HitTestType.Cell)
{
dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dataGrid1.Select(hti.Row);
}
}