This is a migrated thread and some comments may be shown as answers.

Events generated from RadMenuComboItem

4 Answers 116 Views
Menu
This is a migrated thread and some comments may be shown as answers.
James Bonnyman
Top achievements
Rank 1
James Bonnyman asked on 05 Jan 2011, 11:56 AM
Hi!

I am having what I believe should be a simple problem but which I cannot seem to solve!

I have a menu bar onto which I have placed a number of buttons and a RadMenuComboItem the items for which I populate in code via an array list as below (clsDropDown is simply a method to assign the display and value members as Longname and ID respectively).

List.Add(New clsDropdownList("Items Awaiting Collection", 1))
        aList.Add(New clsDropdownList("Items Part Collected", 2))
        aList.Add(New clsDropdownList("Items Collected", 3))
        aList.Add(New clsDropdownList("All Items", 0))


        rddlCollectionStatus.ComboBoxElement.DataSource = aList
        rddlCollectionStatus.ComboBoxElement.DisplayMember = "Longname" ' The combo class always uses 'Longname' for the dropdown text  
        rddlCollectionStatus.ComboBoxElement.ValueMember = "ID"         ' The combo class always uses ID for the dropdown key value 
        rddlCollectionStatus.ComboBoxElement.SelectedIndex = 0

        rddlCollectionStatus.Enabled = True

Within code I can retrieve the ID of the currently selected item and use this to filter following the press of a button from the menu bar, what I cannot do is find an event that fires when the combo box selection changes (I would have expected rddlCollectionStatus_Click or an equivalent to fire but none are seeming to do so).

If anyone can provide a pointer to this it would be much appreciated as it is a little 'clunky' to have to once made the selection on what to filter on to then have to press a button to apply this selection.

Many thanks,

James

4 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 05 Jan 2011, 09:29 PM
Hello James,

You just need to add an Event Handler to capture the SelectedIndexChanged event on the ComboBoxElement. For exmaple
AddHandler Me.RadMenuComboItem1.ComboBoxElement.SelectedValueChanged, AddressOf RadMenuCombo_SelectedValueChanged

Private Sub RadMenuCombo_SelectedValueChanged(ByVal sender As Object, ByVal e As EventArgs)
    MessageBox.Show(Me.RadMenuComboItem1.ComboBoxElement.SelectedValue.ToString())
End Sub

Hope that helps, but let me know if you need more information
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 01:14 PM
Hello,

How did this go? If it helped, please remember to mark as answer. If you need more assistance, please let me know
thanks
Richard
0
James Bonnyman
Top achievements
Rank 1
answered on 07 Jan 2011, 03:12 PM
Hi Richard

The solution was perfect - many thanks

James
0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 03:17 PM
Glad that helped. Please remember to mark as answer
All the best
Richard
Tags
Menu
Asked by
James Bonnyman
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
James Bonnyman
Top achievements
Rank 1
Share this question
or