label1.text=dg1.Items[0].Cells[0].ToString

解决方案 »

  1.   

    http://lucky_elove.www1.dotnetplayground.com/
      

  2.   

    Private Sub WriteDataGrid2Excel2()
        Dim numbercols As Integer = DataGrid1.Items.Item(0).Cells.Count
        Dim i As Integer = 0
        Dim j As Integer = 0    ' 输出字段内容
        For j = 0 To DataGrid1.Items.Count - 1
          For i = 0 To numbercols - 1
            response.write(DataGrid1.Items.Item(j).Cells(i).Text)
          Next
        Next
      End Sub
      

  3.   

    label1.text=dg1.Items[y].Cells[x].ToString
      

  4.   

    label1.text=dg1.Items[0].Cells[0].ToString();
    (C#下的)
      

  5.   

    foreach(DataGridItem dg in DataGrid.Items)
    {
       dg.cells[index]   这就是遍历的方法,可以取得任何的格子
    }
      

  6.   

    dg1.Items[0].Cells[n].ToString
    n为想取的单元个序号
      

  7.   

    TextBox1.Text = dataSet11.Tables["address_list"].Rows[0][0].ToStri();
    address_lsit为dataSet所用的表名。