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. Image for the cookie policy date

How to detect when a user add a BarItem in the XPToolBar?

I need to ask to the user some information when it add a BarItem in a XPToolBar during a customization. Thanks.

5 Replies

AD Administrator Syncfusion Team August 19, 2004 06:05 PM UTC

Hi Antonio, You could use the XPToolBar.Items'' CollectionChanged event for this purpose as shown in the code below : this.xpToolBar1.Items.CollectionChanged += new CollectionChangeEventHandler(BarItemsCollection_Changed); private void BarItemsCollection_Changed (object sender, CollectionChangeEventArgs args) { if (args.Action == CollectionChangeAction.Add) MessageBox.Show("BarItem Added"); else if (args.Action == CollectionChangeAction.Remove) MessageBox.Show("BarItem Removed"); } Please refer to the sample attached here that shows how this can be done, and let me know if you need further assistance. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


AG Antonio Ganci August 20, 2004 04:53 AM UTC

Thanks for the answer but when I add a BarItem from the CustomizationDialog by drag and drop the collection fire the message with Action = Refresh so I don''t know which item is added. If I remove or add an Item from the ''Add or Remove Buttons'' menu it doesn''t fire the event. Antonio Ganci.


AD Administrator Syncfusion Team August 23, 2004 04:33 PM UTC

Hi Antonio, To accomodate your request, we have now changed the following public methods to public virtual methods in the MainFrameBarManager. /* This will be called when the user toggles the visibility of a BarItem through the “Add Remove Buttons” menu */ public virtual void SetUserVisibilityPreferenceInBar(BarItem barItem, Bar bar, bool showOrHide) /* This will be called when the user adds a BarItem to a Bar or ParentBarItem */ public virtual void RecordInsert(BarItem sourceItem, BarItem adjacentItem, IBarItemContainer destination, bool beforeOrAfter) /* This will be called when the user removes a BarItem from a Bar or ParentBarItem */ public virtual void RecordRemove(BarItem sourceItem, IBarItemContainer destination) So, if these methods are overridden they will be called when the you perform the respective actions. Note that these changes are still internal and will be available in the next release of Essential Suite (post v2.1.0.9 releases). Thanks for your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


AG Antonio Ganci August 24, 2004 10:54 AM UTC

Thank you. When do you think to release the next version of SyncFusion? Antonio Ganci


AD Administrator Syncfusion Team August 24, 2004 12:42 PM UTC

Hi Antonio, Typically, we release a new build of Essential Suite once in every 3-4 weeks. The above features will be available in our next release. Please create a Direct-Trac incident in this regard, and I will update you when our next build is available. We appreciate your continued interest inSyncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Up arrow icon