Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDataSource
Imports Infragistics.Win.UltraWinGrid
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        ' Clear method removes all the bands from the child bands collection.
        Me.UltraDataSource1.Band.ChildBands.Clear()
        ' You can add child bands using Insert or add methods.
        Me.UltraDataSource1.Band.ChildBands.Insert(0, "ChildBand0")
        Me.UltraDataSource1.Band.ChildBands.Insert(1, "ChildBand1")
        ' You can get the child band using the child band key or an integer index.
        '
        Dim childBand0 As UltraDataBand = Me.UltraDataSource1.Band.ChildBands("ChildBand0")
        ' Add two columns to the child band 0.
        childBand0.Columns.Insert(0, "Col0", GetType(String))
        childBand0.Columns.Insert(1, "Col1", GetType(DateTime))
        ' This time get the child band using an integer index.			
        Dim childBand1 As UltraDataBand = Me.UltraDataSource1.Band.ChildBands(1)
        ' Add two columns to the child band.
        childBand1.Columns.Insert(0, "Col0", GetType(Integer))
        childBand1.Columns.Insert(1, "Col1", GetType(Double))
    End Sub
    Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim childBand0 As UltraDataBand = Me.UltraDataSource1.Band.ChildBands(0)
        Dim childBand1 As UltraDataBand = Me.UltraDataSource1.Band.ChildBands(1)
        ' You can remove a column by either specifying a column key or an index.
        childBand0.Columns.Remove("Col0")
        childBand1.Columns.RemoveAt(0)
        ' The same goes for the child bands.
        Me.UltraDataSource1.Band.ChildBands.Remove("ChildBand0")
        Me.UltraDataSource1.Band.ChildBands.RemoveAt(0)
    End Sub