Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics
' Add the following code to an Initialize method of your form
' Typically InitializeComponent or Form.Load
' Set the band to Card View mode
Me.ultraGrid1.DisplayLayout.Bands(0).CardView = True
' Set the CardStyle to Compressed to compress all the cards showing only the caption
Me.ultraGrid1.DisplayLayout.Bands(0).CardSettings.Style = CardStyle.Compressed
' Subscribe to the BeforeCardCompressedStateChanged and AfterCardCompressedStateChanged events
Me.ultraGrid1.BeforeCardCompressedStateChanged += New Infragistics.Win.UltraWinGrid.BeforeCardCompressedStateChangedEventHandler(Me.ultraGrid1_BeforeCardCompressedStateChanged)
Me.ultraGrid1.AfterCardCompressedStateChanged += New Infragistics.Win.UltraWinGrid.AfterCardCompressedStateChangedEventHandler(Me.ultraGrid1_AfterCardCompressedStateChanged)
Private Sub ultraGrid1_BeforeCardCompressedStateChanged(sender As Object, e As Infragistics.Win.UltraWinGrid.BeforeCardCompressedStateChangedEventArgs)
' The BeforeCardCompressedStateChanged event fires before a Card Row is Expanded/Compressed
' when the band is in CardCompressedView.
' The Row property of the BeforeCardCompressedStateChangedEventArgs event argument provides
' a reference to the UltraGridRow undergoing a CardCompressedState change.
Debug.WriteLine(("CardCaption: " + e.Row.CardCaption))
' The NewCompressedState property specifies the new CardCompressedState of the row: Compressed or Expanded.
If e.NewCompressedState = CardCompressedState.Expanded Then
Debug.WriteLine("The row is expanding")
Else
If e.NewCompressedState = CardCompressedState.Compressed Then
Debug.WriteLine("The row is compressing")
End If
End If
' BeforeCardCompressedStateChangedEventArgs provides a Cancel property to indicate whether the event
' should be canceled.
e.Cancel = True
End Sub 'ultraGrid1_BeforeCardCompressedStateChanged
Private Sub ultraGrid1_AfterCardCompressedStateChanged(sender As Object, e As Infragistics.Win.UltraWinGrid.AfterCardCompressedStateChangedEventArgs)
' The AfterCardCompressedStateChanged event fires after a Card Row is Expanded/Compressed
' when the band is in CardCompressedView.
' The Row property of the AfterCardCompressedStateChangedEventArgs event argument provides
' a reference to the UltraGridRow undergoing a CardCompressedState change.
Debug.WriteLine(("CardCaption: " + e.Row.CardCaption))
' The NewCompressedState property specifies the new CardCompressedState of the row:
' Compressed or Expanded.
If e.NewCompressedState = CardCompressedState.Expanded Then
Debug.WriteLine("The row has expanded")
Else
If e.NewCompressedState = CardCompressedState.Compressed Then
Debug.WriteLine("The row has compressed")
End If
End If
End Sub 'ultraGrid1_AfterCardCompressedStateChanged