请教1个问题...谢谢...
在Winform中怎样单击DataGridView单元格而选择的是整行.在线等.解决马上结帖.
------解决方案--------------------2003中datagrid选中行的方法。
----------------------------
private void dataGridSchedule_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
DataGrid.HitTestInfo hti;
hti=dataGridSchedule.HitTest(e.X ,e.Y );
switch(hti.Type)
{
case System.Windows.Forms.DataGrid.HitTestType.None:
break;
case System.Windows.Forms.DataGrid.HitTestType.Cell:
this.dataGridSchedule.Select(hti.Row );
break;
case System.Windows.Forms.DataGrid.HitTestType.ColumnHeader:
break;
case System.Windows.Forms.DataGrid.HitTestType.RowHeader:
break;
case System.Windows.Forms.DataGrid.HitTestType.ColumnResize:
break;
case System.Windows.Forms.DataGrid.HitTestType.RowResize:
break;
case System.Windows.Forms.DataGrid.HitTestType.Caption:
break;
case System.Windows.Forms.DataGrid.HitTestType.ParentRows:
break;
}
}
------解决方案--------------------没做过Winform
看一下MSDN相应的事件与方法咯
------解决方案--------------------错了,那个是点击行头选择,是这个
SelectionMode = DataGridViewSelectionMode.FullRowSelect