[C#]
string sText = dg.Row[i].Cell[j].Text;

解决方案 »

  1.   

    for(int i=0;i<DataGrid1.Items.Count;i++)
    {
    string str=DataGrid1.Items[i].Cells[列名].Text;
    }
      

  2.   

    fushuming(阿宝) ( ) 信誉:38 赫赫,怎么搞的?
      

  3.   

    System.Windows.Forms.DataGrid”并不包含对“Item”的定义
      

  4.   

    更正如下:
    for(int i=0;i<DataGrid1.Items.Count;i++)
    {
    string str=DataGrid1.Items[i].Cells[列号].Text;
    }
      

  5.   

    在DataGrid中定义onmouseup事件     
        System.Drawing.Point pt = new Point(e.X, e.Y); 
         DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt); 
         if(hti.Type == DataGrid.HitTestType.Cell) 
         { 
              TextBox1.Text = DataGrid1[hti.Row, hti.Column].ToString(); 
         } 
      

  6.   

    我的机器找不到DataGrid.HitTestInfo 对象。
    什么原因?是否.net版本有别?(version 2002)