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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ToolBar

Thread ID:

Created:

Updated:

Platform:

Replies:

49409 Sep 18,2006 05:34 PM UTC Sep 19,2006 09:38 PM UTC General Discussion 4
loading
Tags: General Discussion
Ajay Bhalegar
Asked On September 18, 2006 05:34 PM UTC

Hi,

I want to create a ToolBar which has dynamically created Toolbar items and on click of ToolbarItem i want to pass a value depending on toolbaritem.
Is there any sample for dynamically creating toolbar and passing parameters to the toolbaritem method.

Thanks & Regards
Ajay

Purusothaman R [Syncfusion]
Replied On September 18, 2006 10:07 PM UTC

Hi Ajay,

The Toolbar can be created dynamically through the code, by initializing MainFrameBarManager, ParentBarItems and Bar Items in the Form''s Constructor.

I have attached a sample to illustrate the creation of tool bars dynamically and handling its click event.

Please let me know, whether this is what you actually needed.
Thanks for using Syncfusion Products.

http://www.syncfusion.com/Support/user/uploads/ToolbarCode_9561084f.zip

Regards,
Purusothaman.R

Ajay Bhalegar
Replied On September 19, 2006 05:15 PM UTC

Hi Purusothaman,


Ajay Bhalegar
Replied On September 19, 2006 05:20 PM UTC

Hi Purusothaman,

I tried using your sample it is quite similar to what my requirement are, but in your sample you are showing it using MainFrameBarManager , but i have a contextmenu which has multiple bar items on whose click it should open a form depending on the barItem.

I tried with PopupMenusManager.SetXPContextMenu
but this requires a control, but in my case i dont have any control its a toolbar so its not working.

Is there any way to show in context menu.

Thanks & Regards
Ajay

Purusothaman R [Syncfusion]
Replied On September 19, 2006 09:38 PM UTC

Hi Ajay,

Multiple bar items can be added to the Context Menu during runtime through code and also their click event can be handled depending on the Bar Item.

The Popup Menu can be attached to the Form by setting the "SouceControl" property of the PopupMenu to the Form and display it using show method on MouseUp event. This excludes the usage of PopupMenusManager. Here is the code snippet.

PopupMenu1.SourceControl = this;

The second and recommended method to associate the Popupmenu with the form is, to use the following snippet.

popupMenusManager1.SetXPContextMenu(this, PopupMenu1);

No other control is needed to associate the context menu with the form.

A sample has been attached here and please let me know if this helps.

PopupCode.zip


Thanks for using Syncfusion Products.

Regards,
Purusothaman.R

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.

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

;