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

context menus crash application

Hello, I am posting the following code to obtain insight from the forum. We are using the Adv Tree View control and Menu control. I am displaying a context menu as the result of a right click in the adv tree view control. If I close the application via the system X button while the context menu is shown. I recieve this exception An unhandled exception of type ''System.ArgumentOutOfRangeException'' occurred in system.windows.forms.dll Additional information: Specified argument was out of the range of valid values. If I click any where in the application to dismiss the context menu, then close the applicaiton. The exception is not thrown. Here is my OnMouseDown code: private void tvaDataMgr_MouseDown (object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { switch (((Hashtable) ((TreeViewAdv) sender).GetNodeAtPoint (e.X, e.Y).Tag)["Type"].ToString ()) { case "ReportYear": this.pmYear.Show (this.tvaDataMgr, new Point (e.X, e.Y)); break; case "ReportEntity": this.pmEntity.Show (this.tvaDataMgr, new Point (e.X, e.Y)); break; case "Region": this.pmRegion.Show (this.tvaDataMgr, new Point (e.X, e.Y)); break; case "Branch": this.pmBranch.Show (this.tvaDataMgr, new Point (e.X, e.Y)); break; } } } Thank you for your help Jason

10 Replies

AD Administrator Syncfusion Team March 15, 2004 04:13 PM UTC

Hi Jason, Please refer to the sample attached (created in our latest release) which shows how you could use our PopupMenus in a TreevIewAdv. In this sample, the PopupMenu gets displayed showing the name of the TreeNodeAdv when right clicked on it. Let me know if this helps. If not, kindly modify the sample and send it back to us so that we can take a look at it. Also let me know the version of Essential Suite that you are using. Thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


JJ Jason Jennings March 15, 2004 05:30 PM UTC

I think I may have left out one import detail. We are using the Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu menus not the Windows Context Menus. I''m not sure which version of controls we are using. Chris Riikonen. I think we have version Beta 2. Jason >Hi Jason, > >Please refer to the sample attached (created in our latest release) which shows how you could use our PopupMenus in a TreevIewAdv. In this sample, the PopupMenu gets displayed showing the name of the TreeNodeAdv when right clicked on it. Let me know if this helps. If not, kindly modify the sample and send it back to us so that we can take a look at it. Also let me know the version of Essential Suite that you are using. Thanks for choosing Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.


AD Administrator Syncfusion Team March 15, 2004 05:56 PM UTC

Hi Jason, Thanks for the update. I have modified my earlier sample to use Syncfusion PopupMenu instead of the .NET ContextMenu, and have attached_it_here. Please refer to the sample and let me know if this meets your requirements. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


JJ Jason Jennings March 15, 2004 06:12 PM UTC

Will the pop up manager work with Multiselect same level and with a different pop up at each node level? Notice my code example is displayng a different pop up depending on the node that was clicked. Jason >Hi Jason, > >Thanks for the update. I have modified my earlier sample to use Syncfusion PopupMenu instead of the .NET ContextMenu, and have attached_it_here. Please refer to the sample and let me know if this meets your requirements. We appreciate your interest in Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.


AD Administrator Syncfusion Team March 15, 2004 08:15 PM UTC

Hi Jason, The PopupMenusManager works fine with multiple/multilevel selection as well. The intention of my earlier sample was display the selected node in the PopupMenu. But if you wish to display the same items in the PopupMenu, you could do so by simply adding the BarItems to the PopupMenu.ParentBarItem''s Items collection as shown below : this.popupMenu1.ParentBarItem.Items.Add(new BarItem("BarItem1")); this.popupMenu1.ParentBarItem.Items.Add(new BarItem("BarItem2")); this.popupMenu1.ParentBarItem.Items.Add(new BarItem("BarItem3")); I have modified my earlier sample accordingly and have attached it here. Please refer to it and let me know if this meets your requirements. Regards, Guru Patwal Syncfusion, Inc.


CR Chris R March 16, 2004 05:34 PM UTC

It actually is a problem with the docking manager that we are using. Here is your example modified to show the problem. Right-click on a node and leave the menu up and the click on the "X" to close the application. Chris R. crashtest_3570.zip


AD Administrator Syncfusion Team March 16, 2004 06:27 PM UTC

Hi Chris, Thanks for the modified the sample. I could see the crash here, and have notified the development team in this regard. I will update you as soon as I hear from them. We appreciate your feedback, and thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


AD Administrator Syncfusion Team March 17, 2004 02:00 PM UTC

Hi Chris, This issue has now been taken care of internally and the fixes are expected to be included in our next release (post v2.0 RC1). Thanks for your feedback, and we appreciate your interest in Syncfusion. Regards, Guru Patwal Syncfusion, Inc.


CR Chris R March 17, 2004 03:43 PM UTC

When will this be available? Is there any workaround for this? This is a "show-stopping" error.


AD Administrator Syncfusion Team March 17, 2004 07:44 PM UTC

Hi Chris, I am afraid, I am unable to give you a timeframe for the next release. Please open an incident in DirectTrac in this regard, and we will update with more information there. We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon