1.DataGrid控件中的行宽和列高如何固定?让用户不能随便拖动改变.
  2.DataGrid显示的内容不能更改.相当于readonly
  3.DataGrid如何实现选中整行数据,而不是点中某一个数据.呵呵,三个问题.谢谢.

解决方案 »

  1.   

    to 问题2.DataGrid.ReadOnly=true;
           3.DataGrid.Rows.Select(DataGrid.CurrentRow.Index);
           1.忘记了。
     现在用的是VS 2005,你试试看上述方法。
      

  2.   

    ONMouseMove 和onMouseDown 事件中写以下代码
    DataGrid.HitTestInfo   hti   =   this.HitTest(new   Point(e.X,   e.Y));     
      if(hti.Type   ==   DataGrid.HitTestType.ColumnResize)     
      {     
      return;   
      }     
      

  3.   

    1:AllowUsersToResizeColumns=false,用户就不可以拖动了..
    2:DataGridView.ReadOnly=true.或者你设置每一列的ReadOnly=true
    3:DataGridView.Rows.Select(DataGrid.CurrentRow.Index);
      

  4.   

    to 我的是2005,好象行不通VS 2005中应该是DataGridView,不应该是DataGrid.
      

  5.   

    我试了,但是不行.我打标点后不能弹出select方法