2--public class MyDataGrid : DataGrid 

     protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) 
     { 
 
          DataGrid.HitTestInfo hti = this.HitTest(new Point(e.X, e.Y)); 
          if(hti.Type == DataGrid.HitTestType.ColumnResize
            || hti.Type == DataGrid.HitTestType.RowResize) 
          {
                return;
          }
          base.OnMouseDown(e);
   
     } 
 

 

解决方案 »

  1.   

    3--你用sql语句来写,在最后加一个合计列,然后用union把两个结果合起来。
    1--用DataRow.RowError,你查查帮助就可以了。
      

  2.   

    1:是你的数据库里对应的这个字段不是4位的,所以会提示这个错误!
    2:DataGrid1.HeaderStyle.Height = ...;
      DataGrid1.HeaderStyle.Width = ...;
    3:只能在做一行,统计!!
      

  3.   

    回答3:要加统计行,首先应该在后台类中,对DataGrid要绑定的数据源进行补充,比如说在DataTable中新增一行,然后循环DataTable中的数据行,统计要统计的数据,将其填充在最后一行。
      

  4.   

    例:
    select picturesize from picture 
    union
    select sum(picturesize) from picture