I am creating a ExplorerBar at runtime and adding a group and item to it. I also add an event handler as shown. When I execute the application, the event doest get fired. How do I get this to work? Due to the design of the application, I need to do this dynamically.
Private Sub AddNavPanel()
'Create explorer bar Dim ctlLeftNavSubPanel As New UltraWinExplorerBar.UltraExplorerBar ctlLeftNavSubPanel.Style = UltraExplorerBarStyle.VisualStudio2005Toolbox ctlLeftNavSubPanel.GroupSettings.Style = Infragistics.Win.UltraWinExplorerBar.GroupStyle.SmallImagesWithText
'Add a group to it Dim ctlGroupItemsList As New UltraWinExplorerBar.UltraExplorerBarGroupctlGroupItemsList.Text = "Sub Group 1"ctlGroupItemsList.Key = "Sub Group 1"ctlLeftNavSubPanel.Groups.Add(ctlGroupItemsList)'Add items to the groupDim ctlGroupItem As New UltraWinExplorerBar.UltraExplorerBarItemctlGroupItem.Text = "Item 1"ctlGroupItem.Key = "Item 1"ctlGroupItemsList.Items.Add(ctlGroupItem)
'Add event handler AddHandler ctlLeftNavSubPanel.ItemClick, AddressOf Me.ctlLeftNavSubPanel_ItemClick
End sub
Private Sub ctlLeftNavSubPanel_ItemClick(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinExplorerBar.ItemEventArgs) Dim s As String s = e.Item.Text End Sub
Forgot to mention that the version I am using is NetAdvantage 8.2 clr2.x
ItemClick does not fire for state button items, which is what you have by default when the style is set to VisualStudio2005Toolbox. You can change this by setting the UltraExplorerBar.ItemSettings.Style property to 'Button'.