We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I add PopupMenuItems in grid at runtime.

Thread ID:





53472 Dec 14,2006 06:05 AM UTC Dec 14,2006 07:06 AM UTC WinForms 1
Tags: GridControl
Asked On December 14, 2006 06:05 AM UTC


I have added a PopupMenuItems in a data grid at runtime based on the data from database. I need to do different activities for different PopupMenuItems click event. How can i do this?

Here is the code which I wrote, but the problem is how can I identify which barItem is clicked when "barItem_Click" event is fired.

BarItems barItems = new BarItems;
for (int i = 1; i <= 5; i++)
BarItem b = new BarItem();
b.Text = i.ToString();
b.Checked = true;
b.Click += new EventHandler(barItem_Click);
grid.PopupMenuItems = barItems;


Administrator [Syncfusion]
Replied On December 14, 2006 07:06 AM UTC

Hi Ravi,

Use the Name/Text property to find the BarItem in a BarItem.Click event. Here is a code snippet

private void barItem_Click(object sender, System.EventArgs e)
BarItem b = sender as BarItem;
if( b.Name == "barItem1")
MessageBox.Show("BarItem[1] is Clicked");

Best Regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon