Error while running a form that contains navigation drawer

hello

im trying to create a navigation drawer in my main form but when i run the app and try clicking on the drawer i get this error
call stack:

System.InvalidCastException

  HResult=0x80004002

  Message=Unable to cast object of type 'System.Windows.Forms.Control' to type 'Syncfusion.Windows.Forms.Tools.DrawerMenuItem'.

  Source=Syncfusion.Tools.Windows

  StackTrace:

   at Syncfusion.Windows.Forms.Tools.NavigationDrawerMouseMessageFilter.PreFilterMessage(Message& m)

   at System.Windows.Forms.Application.ThreadContext.ProcessFilters(MSG& msg, Boolean& modified)

   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

   at System.Windows.Forms.Application.ThreadContext.Microsoft.Office.IMsoComponent.FPreTranslateMessage(MSG* msg)

   at System.Windows.Forms.Application.ComponentManager.Microsoft.Office.IMsoComponentManager.FPushMessageLoop(UIntPtr dwComponentID, msoloop uReason, Void* pvLoopData)

   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(msoloop reason, ApplicationContext context)

   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(msoloop reason, ApplicationContext context)

   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

   at SolaresERP_Rangala.Form1.button1_Click(Object sender, EventArgs e) in D:\My C# Projects\WInforms\SolaresERP_Rangala\V1\SolaresERP_RangalaApp\SolaresERP_Rangala\Form1.cs:line 19

   at System.Windows.Forms.Button.OnClick(EventArgs e)

   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.ButtonBase.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)



screen shot of the form (i dont know why it looks like that and if its normal or not):




1 Reply

BS Bhaskar Suresh Syncfusion Team March 18, 2024 02:23 PM UTC

Hi Muhammad,


We are unable to reproduce the reported issue based on the given information.


Could you please share the following information so that we can provide a solution?

  • Version of the Package used in the application.
  • Code snippet of the control.
  • Modified sample that replicates the issue.


Regards,

Bhaskar Suresh


Loader.
Up arrow icon