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

ContextMenu on RadCheckedDropDownList

1 Answer 90 Views
CheckedDropDownList
This is a migrated thread and some comments may be shown as answers.
Stefano
Top achievements
Rank 1
Stefano asked on 21 Jan 2020, 02:32 PM

I'd like to show a custom context menu when the user right clicks on an RadCheckedDropDownList item

What is the best way to do it?

 

I've tried setting the ContextMenuStrip property, as in:

    dropDownList.ContextMenuStrip = contextMenuStrip1;

but both my custom menu strip and the default context menu appears. See the attached image

 

 

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 23 Jan 2020, 01:46 PM

Hello Stefano,

If you want to customize the context menu in RadChechedDropDownList it is suitable to subscribe to the ContextMenuOpening event where you have access to the context menu:

this.radCheckedDropDownList1.CheckedDropDownListElement.AutoCompleteEditableAreaElement.AutoCompleteTextBox.ContextMenuOpening += this.AutoCompleteTextBox_ContextMenuOpening;
private void AutoCompleteTextBox_ContextMenuOpening(object sender, TreeBoxContextMenuOpeningEventArgs e)
{
    e.ContextMenu.DropDown.Items.Clear();
    e.ContextMenu.Items.Add(new RadMenuItem("Test item"));
}

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Nadya
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.
Tags
CheckedDropDownList
Asked by
Stefano
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or