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

InvalidCastException received when adding NavigationView Component to the RibbonForm

Hi:
InvalidCastException received when adding NavigationView Component to the RibbonForm.
Sometimes it can be added to the form , but mostly it will throw an InvalidCastException. I donnot know why. Someone will be so kindly to help me. Thanks.



error_b78b38e9.jpg

3 Replies

BA Balavasanth Syncfusion Team September 4, 2009 10:33 AM UTC

Hi Guy Huang,

Thanks for your interests in Syncfusion products.

We are not able to reproduce your issue, instead we tried to create a simple sample by adding a Navigation view component control in to the Ribbon Form. But we could see that everything works fine. Please find the sample from the below location.

http://files.syncfusion.com/support/Tools.Windows/7.3.0.20/89637/main.htm

and try reproducing the issue.

And also from your screen shot we could see that you have exceptions raising in the XpMenuProvider class, so we are not sure in what case you get this issue. So if you could still reproduce the issue, please give us more information about your exact issue or even a simple sample where we can reproduce the issue could be much helpful for us to investigate further and fix the issue, if any.

Please let us know if you have any queries.

Regards,
Bala.


JL Jin Long Suan September 7, 2009 02:56 AM UTC

Dear Bala:
Glad to receive your reply.
The attachment is my project. It is created by VS2008 SP1, the target platform is Net2.0. The steps as followings:
1.Create a WinForm project. VS has automaticly added a subclass of System.Windows.Forms.Form named form1.
2.Modify the form1's fatherclass to RibbonForm class. Build and find no errors.
3.Add some other controls, such as RibbonControlAdv, DockingManager, ToolStripTabItem, TreeViewAdv and so on.Build and find no errors.
4.Delete some controls. Do some necessary modifies and build.
5.Add NavigationBar control onto form and will receive the Exception.

Also I found some other strange issues. When I already added a GroupBar Control and set the properties. Then i build the project, i will receive an Design Error, the message is like "未找到组件所提供的根", in English is like "unable to find the root of the control". Click "ignorn and continue" button, the form opened in design mode, but the groupbar has gone! And then I cannot add groupbar to the form, it will receive the same invalidCastException.

Thank you.



ClientOutlook_7fa9e1da.rar


BA Balavasanth Syncfusion Team September 8, 2009 07:27 AM UTC

Hi Guy Huang,

Thanks for the detailed replication procedure.

We are able to see the InvalidCastException problem in your sample when we tried to add a Groupbar(you mean as a NavigationView Component) in to the Ribbon ControlAdv. But when we tried to create a sample on your requirement we are not able to see any such issues, because we tried to add Groupbar to the Form first then we add the RibbonControlAdv to our application and then using the "bring to front" the Groupbar and align it where it has to be displayed. Then we added the rest of the controls. Kindly make use of the sample for more idea. We hope this will help you.

main.htm

And also we hope that you are trying to implement a sample similar to Outlook, we have already implemented Outlook demo sample with the windows sample browser(Product Show case sample --> Outlook Demo), please have a look in to the screen shot for more idea.

outlook.png

Please let us know if you have any queries.

Best,
Bala.




Loader.
Live Chat Icon For mobile
Up arrow icon