Selezionare Tutta la Riga - C# 2003
//Per selezionare tutta la riga quando si clicca su una cella
private void dgArticoli_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Drawing.Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dgArticoli.HitTest(pt);
if (hti.Type == DataGrid.HitTestType.Cell)
{
dgArticoli.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dgArticoli.Select(hti.Row);
}
}
private void dgArticoli_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Drawing.Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dgArticoli.HitTest(pt);
if (hti.Type == DataGrid.HitTestType.Cell)
{
dgArticoli.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dgArticoli.Select(hti.Row);
}
}
Commenti