可以参考下面的代码
- Public Sub New()
- InitializeComponent()
-
- Dim gcMultiRow = New GcMultiRow() With { _
- Key .Width = 500 _
- }
- Me.Controls.Add(gcMultiRow)
-
- Dim template__1 = Template.CreateGridTemplate(10)
-
- For i As var = 0 To 9
- template__1.Row.Cells(i).DataField = "column{i}"
- Next
-
- Dim dataTable = New DataTable()
- For i As var = 0 To 9
- dataTable.Columns.Add(New DataColumn("column{i}", GetType(String)))
- Next
- For i As var = 0 To 9
- Dim row = dataTable.NewRow()
- For j As var = 0 To 9
- row("column{j}") = "({i} , {j})"
- Next
- dataTable.Rows.Add(row)
- Next
-
- gcMultiRow.Template = template__1
- gcMultiRow.DataSource = dataTable
-
- gcMultiRow.FreezeLeftCellIndex = 1
- gcMultiRow.FreezeRightCellIndex = 9
- End Sub
复制代码
|