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

DropDownItemClicked

9 Answers 288 Views
Toolstrip (obsolete as of Q3 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joseba_Beloki
Top achievements
Rank 1
Joseba_Beloki asked on 18 Jan 2007, 12:45 PM
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

9 Answers, 1 is accepted

Sort by
0
Chris
Telerik team
answered on 19 Jan 2007, 01:14 PM
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
0
AT
Top achievements
Rank 1
answered on 17 Apr 2007, 02:31 AM
Hi,

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

Mark
0
Jordan
Telerik team
answered on 17 Apr 2007, 07:35 AM
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
0
R
Top achievements
Rank 1
answered on 02 Jan 2008, 10:58 PM
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
0
Georgi
Telerik team
answered on 04 Jan 2008, 05:13 PM
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
0
R
Top achievements
Rank 1
answered on 04 Jan 2008, 05:27 PM
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
0
R
Top achievements
Rank 1
answered on 19 Mar 2009, 04:29 PM
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
0
Nikolay
Telerik team
answered on 20 Mar 2009, 04:26 PM
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.
0
R
Top achievements
Rank 1
answered on 21 Mar 2009, 12:57 AM
Thank you.  That is exactly what I did.  I saw it in another post.

Randy
Tags
Toolstrip (obsolete as of Q3 2010)
Asked by
Joseba_Beloki
Top achievements
Rank 1
Answers by
Chris
Telerik team
AT
Top achievements
Rank 1
Jordan
Telerik team
R
Top achievements
Rank 1
Georgi
Telerik team
Nikolay
Telerik team
Share this question
or