Hello Adi,
Thank you for contacting Telerik Support.
I have modified a little bit your code to obtain the results from the attached picture:
private
void
Form1_Load(
object
sender, EventArgs e)
{
// TODO: This line of code loads data into the 'nwindDataSet.Customers' table. You can move, or remove it, as needed.
this
.customersTableAdapter.Fill(
this
.nwindDataSet.Customers);
contextMenu =
new
RadContextMenu();
RadMenuItem menuItem =
new
RadMenuItem(
"Add Item"
);
RadDropDownList fontDropDownList =
new
RadDropDownList();
fontDropDownList.Text =
"Select Font"
;
fontDropDownList.Items.Add(
new
RadListDataItem(
"Arial"
));
fontDropDownList.Items.Add(
new
RadListDataItem(
"Tahoma"
));
fontDropDownList.Items.Add(
new
RadListDataItem(
"Times New Roman"
));
fontDropDownList.Items.Add(
new
RadListDataItem(
"Verdana"
));
RadMenuContentItem contentItem =
new
RadMenuContentItem();
RadHostItem host =
new
RadHostItem(fontDropDownList);
contentItem.ContentElement = host;
contentItem.AutoSize =
false
;
contentItem.Size =
new
System.Drawing.Size(150, 100);
menuItem.Items.Add(contentItem);
contextMenu.Items.Add(menuItem);
}
private
void
radGridView1_ContextMenuOpening(
object
sender, ContextMenuOpeningEventArgs e)
{
e.ContextMenu = contextMenu.DropDown;
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application.
Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>