【问题标题】:Derive row from unboound DataGridVew从未绑定的 DataGridView 派生行
【发布时间】:2012-01-04 00:03:45
【问题描述】:

我有一个 12 列的数据网格视图。当我尝试使用下面的代码从 DataGridView 派生新的 DataGridViewRow 时,row.Cells 计数为 0。

可以从 DataGridView 派生新行,因此我不必以编程方式添加列。我已经设计了列,我不想为每一行再次手动添加它们。

谢谢, 苏珊

        For Each rowSQL As MyDataSet.GetStudentRow In Me._CurrentOrder.GetStudents.Rows
        Dim row As DataGridViewRow = Me.dgDetails.RowTemplate

        For Each cell As DataGridViewCell In row.Cells
            Dim aa As String = cell.Value.ToString
        Next
    Next

【问题讨论】:

    标签: datagridview row


    【解决方案1】:
    Dim row As New DataGridViewRow
    row.CreateCells(Me.dgDetails)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-25
      • 1970-01-01
      • 2020-05-09
      • 2010-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-24
      相关资源
      最近更新 更多