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

RadDropDownButton ?

3 Answers 78 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Deasun
Top achievements
Rank 1
Deasun asked on 06 Sep 2018, 07:21 PM

In design time I have added one of these to my form.

And added items to it thru the UI.

Now I want to capture when the user clicks on one of them items.

How to I do that? Not seeing an event for it. Only for the button click which fires off even when you don't click on one of the items.

Sorry tis late and the office is hot, I am just not seeing it.

Thanks in advance.

Deasun.

 

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 07 Sep 2018, 09:34 AM
Hello Deasun,

Each menu item has its own Click event. Here is how to use it:
public RadForm1()
{
    InitializeComponent();
 
    radMenuItem1.Click += RadMenuItem1_Click;
}
 
private void RadMenuItem1_Click(object sender, EventArgs e)
{
     
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Deasun
Top achievements
Rank 1
answered on 07 Sep 2018, 11:20 AM

So I have to create the click event link for each item in the dropdown list?

Just want to be sure.

radMenuItem1.Click += RadMenuItem1_Click;

So If I have 7 items I need 7 of these?

as such: radMenuItem2.Click += RadMenuItem2_Click;

radMenuItem3.Click += RadMenuItem3_Click;

and so on?

 

0
Dimitar
Telerik team
answered on 10 Sep 2018, 06:09 AM
Hi Deasun,

Yes, this is correct. 

It is possible however to use the same event handler and check the text. Here is an example:
public RadForm1()
{
    InitializeComponent();
    radMenuItem1.Click += RadMenuItem1_Click;
    radMenuItem2.Click += RadMenuItem1_Click;
}
 
private void RadMenuItem1_Click(object sender, EventArgs e)
{
    var item = sender as RadMenuItem;
    if (item.Text == "radMenuItem1")
    {
 
    }
}

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RibbonBar
Asked by
Deasun
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Deasun
Top achievements
Rank 1
Share this question
or