DropDownItemClicked

10 posts, 0 answers
  1. Joseba_Beloki
    Joseba_Beloki avatar
    1 posts
    Member since:
    Dec 2006

    Posted 18 Jan 2007 Link to this post

    Hi!

    I have to evaluate your product. Now there is a problem with radDropDownButtonElement .
    I have a radDropDownButtonElement in my toolstrip! I filled the radDropDownButtonElement with three Items (RadMenuItems).
    So if one of these Item is clicked I have to make something. So I thought I have to implement the DropDownItemClicked event! But this event doesn't fire! Could you tell me why? And how should I make it?

    Thank you for supporting me!

    Roland
  2. Chris
    Admin
    Chris avatar
    221 posts

    Posted 19 Jan 2007 Link to this post

    Hello Roland,

    If you would like to set event handlers for the Click event to the menu items which you have added in the DropDownButtonElement items collection you should follow the following steps:

    1. Open the Items property collection editor of the dropdown button and add the necessary menu items (for example radMenuItem1, radMenuItem2 and radMenuItem3)
    2. Then close the editor, go to the property grid and select one of the menu items from the drop-down list (for example radMenuItem1).
    3. Set up its Click event.
    4. Repeat 2 and 3 steps for the rest menu items.

    I hope this information helps.

    Sincerely yours,
    Chris
    the telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
  4. AT
    AT avatar
    6 posts
    Member since:
    Aug 2006

    Posted 16 Apr 2007 Link to this post

    Hi,

    That works fine, but what is the DropDownItemClicked event for then?

    Mark
  5. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 17 Apr 2007 Link to this post

    Hello Mark,

    The RadDropDownButton API has been refined and there is no DropDownItemClicked  event any more. We are sorry for the confusion.


    Kind regards,
    Jordan
    the telerik team

    Instantly find answers to your questions at the new telerik Support Center
  6. R
    R avatar
    7 posts
    Member since:
    Oct 2012

    Posted 02 Jan 2008 Link to this post

    I am using the RadRibbonBar with VB 2008.  I have the same issue where I load the RadDropDown dynamically based on entries in a database which can change.  How do you establish a click event when you don't know what the entries are going to be?  Is there a way to check and see if item(0) or item(1) or item(2) is clicked?

    Thanks
  7. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 04 Jan 2008 Link to this post

    Hello R,

    Thank you for writing.

    Perhaps, an acceptable solution in your case could be to subscribe to the Click event for every item you are creating dynamically.

    Please, try this approach and if you need further assistance, do not hesitate to write us again.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. R
    R avatar
    7 posts
    Member since:
    Oct 2012

    Posted 04 Jan 2008 Link to this post

    Georgi,

    What I finally did was to limit the number of drop down entries to 10 (the user should not need more than this) and then created the 10 items using the designer.  At run time the program loads the available selections from the database into the drop down Text properties and collapses the unused items.  It works fine.

    Thanks for the reply.

    Randy
  9. R
    R avatar
    7 posts
    Member since:
    Oct 2012

    Posted 19 Mar 2009 Link to this post

    I am back to this issue again.  What do you mean to subscribe to the click event for each item?  Can you provide an example using VB.net?  To reiterate, I have a dynamically changing number of RadMenuItems in a drop down which I can modify as needed.  How do I test for when an item is clicked and which one it is?

    I found the answer in the following link

    http://www.telerik.com/community/forums/winforms/menu/event-on-radcontextmenu.aspx

    Randy
  10. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 20 Mar 2009 Link to this post

    Hello R,

    Thank you for getting back to us.

    Please review the following code snippet in VB.NET:
    Public Class Form1  
        Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load  
            'data-bind here  
            Dim i As Integer = 0  
            Do While i < Me.RadDropDownButton1.Items.Count  
                AddHandler RadDropDownButton1.Items(i).Click, AddressOf Form1_Click  
                i += 1  
            Loop 
        End Sub 
     
        Private Sub Form1_Click(ByVal sender As ObjectByVal e As EventArgs)  
            Dim item As RadMenuItem = TryCast(sender, RadMenuItem)  
            Console.WriteLine("I am the ""{0}"" item", item.Text)  
        End Sub 
    End Class 

    As you can notice, we are subscribing to the Click event of each item of the RadDropDownButton and when we click on a specific item, we get a message regarding this item.

    Regards,
    Nikolay
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  11. R
    R avatar
    7 posts
    Member since:
    Oct 2012

    Posted 20 Mar 2009 Link to this post

    Thank you.  That is exactly what I did.  I saw it in another post.

    Randy
Back to Top
UI for WinForms is Visual Studio 2017 Ready