Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDataSource
Imports Infragistics.Win.UltraWinGrid
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.UltraGrid1.DataSource = Me.UltraDataSource1
' Add two columns to the root band.
Me.UltraDataSource1.Band.Columns.Add("Col0", GetType(String))
Me.UltraDataSource1.Band.Columns.Add("Col1", GetType(String))
' Add a child band to the root band with the key of "ChildBand".
Dim childBand As UltraDataBand = Me.UltraDataSource1.Band.ChildBands.Add("ChildBand")
' Add two columns to the child band.
childBand.Columns.Add("ChildCol0", GetType(String))
childBand.Columns.Add("ChildCol1", GetType(String))
' Set the count on the root rows collection to 2.
Me.UltraDataSource1.Rows.SetCount(2)
Dim row As UltraDataRow
' Initialize rows with data.
'Get the first row.
row = Me.UltraDataSource1.Rows(0)
row("Col0") = "Row 0, Col 0"
row("Col1") = "Row 0, Col 1"
' Initialize the child rows of the row.
Dim childRows As UltraDataRowsCollection = row.GetChildRows("ChildBand")
childRows.SetCount(2)
childRows(0)("ChildCol0") = "Child Row 0, ChildCol 0"
childRows(0)("ChildCol1") = "Child Row 0, ChildCol 1"
childRows(1)("ChildCol0") = "Child Row 1, ChildCol 0"
childRows(1)("ChildCol1") = "Child Row 1, ChildCol 1"
' Get the second row.
row = Me.UltraDataSource1.Rows(1)
row("Col0") = "Row 1, Col 0"
row("Col1") = "Row 1, Col 1"
' Initialize the child rows of the row.
childRows = row.GetChildRows("ChildBand")
childRows.SetCount(1)
End Sub