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.
Unfortunately, activation email could not send to your email. Please try again.

Not able to access individual baritem from Menu Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

117317 Sep 26,2014 01:13 AM Sep 30,2014 07:10 AM Windows Forms 3
loading
Tags: PopupMenu
Srinivasan
Asked On September 26, 2014 01:13 AM

Team,
I have a popup menu added for our syncfusion data Grid right click option.
When we spy the menu object. We can access only Syncfusion.Windows.Forms.Tools.XPMenus.MenuGrid , Syncfusion.Windows.Forms.Tools.XPMenus.MenuGridHost. Object.
Could you please help me on how to access individual bar item from menu Grid .
Could you please guide me with property or method in menugrid to access baritems.
thanks in advance
.
Srini

Senthil Kumaran Rajan [Syncfusion]
Replied On September 29, 2014 08:53 AM

Hi Srinivasan,

 

Thank you for using Syncfusion products,

 

We would like to let you know that we can access the BarItem  as shown in the below code snippet and also we have prepared a sample for your reference and it is attached below.

 

Code Snippet[C#]:

popupMenu1.ParentBarItem.Items[0].Click += new EventHandler(Form1_Click);

void Form1_Click(object sender, EventArgs e)

        {

            MessageBox.Show((sender as BarItem).Text.ToString());       

        }

 

 

Please let us know if you need further assistance,

 

Regards,

R.Senthil kumaran


Attachment: MenuGrid_e0da349c.zip

Srinivasan
Replied On September 29, 2014 10:04 AM

Good Day!!!

Thank you Senthil for your inputs.

We are trying to do test automation for syncfusion menu Grid. We cannot register event handler to get baritem instance.

Right now I can access MenuGrid and MenuGridHost object.  How can i access List values added in menu Grid . Do we have any class level properties or methods in MenuGrid or MenuGridHost that returns List

My requirement is to retrive individual bar item and to invoke click event on it.

Thanks in advance

Regards,
Srini

Ashwini Jaya Preetha Durai Samy [Syncfusion]
Replied On September 30, 2014 07:10 AM

Hi Srinivasan,

 

Thanks for  your update,

 

As we have explained in our previous update, In PopupMenu child BarItems collection is maintained its ParentBarItem Items collection. Each of BarItem can be accessed from its Items collection.

 

Code Snippet[C#]:

 

        //BarItem stored in Items collection        

        popupMenu1.ParentBarItem.Items[0].Click += new EventHandler(Form1_Click);

        void Form1_Click(object sender, EventArgs e)

        {

            MessageBox.Show((sender as BarItem).Text.ToString());       

        }

 

 

If we have misunderstood your query, can you please share us more details about this requirement? That will be helpful for us to analyze and provide you a prompt solution.

 

Regards,

Ashwini


CONFIRMATION

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.

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.

;