pointInCell100是不是没有初始值,将Button1_Click里的这段代码放到Form_Load中试试。sqlDataAdapter1.Fill(dataSet1,"ROP");
sqlDataAdapter2.Fill(dataSet1,"DV");
dataGrid1.DataSource =dataSet1.Tables["DV];
this.dataGrid1.RowHeaderWidth = 50; 
 pointInCell00 = new Point(dataGrid1.GetCellBounds(0,0).X + 4, dataGrid1.GetCellBounds(0,0).Y + 4);

解决方案 »

  1.   

    问题终于解决了,但出现了一个奇怪的现象。dataGrid1_Paint中如果不调用一下MESSAGEBOX就无法绘出文字来,什么原因那?怎么解决?如果不想弹出MESSAGEBOX的说。
      

  2.   

    不好不好,这种方法会出的文字极不可靠,只要一点击DATAGRID中CELL,该行头文字便消失。怎么解决?SOS!!!!!!