Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView
Private Sub ultraListView1_ItemCheckStateChanging(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemCheckStateChangingEventArgs) Handles ultraListView1.ItemCheckStateChanging
Dim listView As UltraListView = CType(sender, UltraListView)
Try
' Disable the ItemCheckStateChanging and ItemCheckStateChanged events,
' so that we don't cause infinite recursion by setting the CheckState
' property in response to this event.
listView.EventManager.Disable(UltraListViewEventIds.ItemCheckStateChanging)
listView.EventManager.Disable(UltraListViewEventIds.ItemCheckStateChanged)
If listView.ShowGroups AndAlso e.NewValue = CheckState.Checked Then
Dim group As UltraListViewGroup = e.Item.Group
' Iterate the group's Items collection, and uncheck
' all other items except for this one
Dim item As UltraListViewItem
For Each item In group.Items
If Not item Is e.Item Then item.CheckState = CheckState.Unchecked
Next
End If
Finally
' Re-enable the ItemCheckStateChanging and ItemCheckStateChanged events
listView.EventManager.Enable(UltraListViewEventIds.ItemCheckStateChanging)
listView.EventManager.Enable(UltraListViewEventIds.ItemCheckStateChanged)
End Try
End Sub
Private Sub ultraListView1_ItemCheckStateChanged(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinListView.ItemCheckStateChangedEventArgs) Handles ultraListView1.ItemCheckStateChanged
Dim listView As UltraListView = CType(sender, UltraListView)
' Activate and select the item that was checked
e.Item.Activate()
listView.PerformAction(UltraListViewAction.SelectItem, False, False)
End Sub