Events generated from RadMenuComboItem

5 posts, 1 answers
  1. James Bonnyman
    James Bonnyman avatar
    7 posts
    Member since:
    Aug 2005

    Posted 05 Jan 2011 Link to this post

    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
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Jan 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Jan 2011 Link to this post

    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
  5. James Bonnyman
    James Bonnyman avatar
    7 posts
    Member since:
    Aug 2005

    Posted 07 Jan 2011 Link to this post

    Hi Richard

    The solution was perfect - many thanks

    James
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Jan 2011 Link to this post

    Glad that helped. Please remember to mark as answer
    All the best
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready