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

Not Able to Create A Navigation Drawer

The Sample provided is very difficult to understand, and please also me with how can i display my windows form page in navigation drawer when some one click on menus,

i have 4 pages and that should be displayed as per menu selected, also my navigation bar is not coming proper i have attached the screen shot, 

.and when i select the property fill, navigationdrawer does allow me to do branding in title , 

please help me with it


Attachment: se_435b7a57.zip

10 Replies

KR Kannan R Syncfusion Team September 4, 2017 08:48 AM UTC

Hi Ronak,      
      
Thank you for contacting Syncfusion support.       
      
 Please follow the steps below to configure NavigationDrawer control in your application.    
      
Step 1: Add the following listed assemblies to your application.       
      
·         Syncfusion.Grid.Base      
·         Syncfusion.Grid.Windows      
·         Syncfusion.Shared.Base      
·         Syncfusion.Shared.Windows      
·         Syncfusion.Tools.Base      
·         Syncfusion.Tools.Windows      
      
Step 2:  Set the NavigationDrawer settings.      
      
You have to set the NavigationDrawer Panel Width and Height. Make use of the below Code example.       
      
Code Example: [C#]      
     
    
this.navigationDrawer1.DrawerWidth = this.Width / 4;      
this.navigationDrawer1.DrawerHeight = this.Height;      
    
  
         
Step 3: Populate the DrawerMenuItems.       
      
You have to populate the DrawerMenuItems in it. Refer to the below Code example.      
      
Code example: [C#]      
       
this.navigationDrawer1.Items.Add(drawerMenuItem1);      
this.navigationDrawer1.Items.Add(drawerMenuItem2);      
this.navigationDrawer1.Items.Add(drawerMenuItem3);      
this.navigationDrawer1.Items.Add(drawerMenuItem4);      
this.navigationDrawer1.Items.Add(drawerMenuItem5);      
  
      
Step 4: Show/Hide the Sliding Drawer panel.       
      
In NavigationDrawer, ToggleDrawer function is available to show/hide the Drawer panel.       
      
Code example: [C#]      
      
this.navigationDrawer1.ToggleDrawer();      
  
     
We have also prepared a sample for your reference and it can be downloaded from following link.  
 
      
Please check the above solution and let us know if it helps.       
      
Regards,     
Kannan      
 



RO ronak September 4, 2017 09:27 AM UTC

i have a forms with different field 

when i try to add a form ie    form1 f = new form();

 this.navigationDrawer1.Container.Add(f); 

the following code gives me an error   

also tried 

 this.navigationDrawer1.ContentViewContainer.Container.Add(f);


gives the same error 

System.NullReferenceException: 'Object reference not set to an instance of an object.'


its difficult to write code for each control so i am drawing my control on other form and want to show them in in navigation container 



MK Mallika Kannan Syncfusion Team September 6, 2017 04:01 AM UTC

Hi Ronak 
 
Thanks for your update. 
 
Yes, this reported requirement can be achieved by using the below Code snippet.  
 
Please make use of the below Code snippet. 
 
Code Snippet 
 
//Create Object for different Forms  
Home home = new Home(); 
People people = new People(); 
Photos photos = new Photos(); 
Profile profile = new Profile(); 
About_us aboutus = new About_us(); 
 
            home.TopLevel = false; 
            home.AutoScroll = true; 
            home.Text = "Home"; 
            home.Show(); 
            home.Dock = DockStyle.Fill; 
            home.MinimumSize = this.Size; 
 
            people.TopLevel = false; 
            people.AutoScroll = true; 
            people.Text = "People"; 
            people.Show(); 
            people.Dock = DockStyle.Fill; 
            people.MinimumSize = this.Size; 
 
            photos.TopLevel = false; 
            photos.AutoScroll = true; 
            photos.Text = "Photos"; 
            photos.Show(); 
            photos.Dock = DockStyle.Fill; 
            photos.MinimumSize = this.Size; 
 
            profile.TopLevel = false; 
            profile.AutoScroll = true; 
            profile.Text = "Profile"; 
            profile.Show(); 
            profile.Dock = DockStyle.Fill; 
            profile.MinimumSize = this.Size; 
 
            aboutus.TopLevel = false; 
            aboutus.AutoScroll = true; 
            aboutus.Text = "About us"; 
            aboutus.Show(); 
            aboutus.Dock = DockStyle.Fill; 
            aboutus.MinimumSize = this.Size; 
 
 
Screenshot 
 
 
 
 
Kindly please check the above solution and let us know if it is helpful. 
 
Regards, 
Mallika 



RO ronak September 6, 2017 05:09 AM UTC

A Navigation Drawer is used to navigate the pages and show the page inside the navigation drawer container,

the below solution you provide it opens a new form and once the forms are closed the navigation drawer stop working, and he is not able to open the forms again, 

my query was i want to keep navigation drawer a parent and forms as a child pages and they should be added to navigation drawer space 




Attachment: syncfusionProblem_e1c6da29.zip


RO ronak September 6, 2017 05:51 AM UTC

i did few manipulations and my problem is solved, thankyou for the support



MK Mallika Kannan Syncfusion Team September 6, 2017 06:03 AM UTC

  
Hi Ronak 
 
Thanks for your update. 
 
We are glad to hear that we have helped you on this. 
 
Please let us know if you need have any other assistance. 
 
Regards, 
Mallika 



RO ronak September 6, 2017 06:16 AM UTC

i get the below error whenever i close the form which have navigation drawer, 

can you please help over it


Attachment: erro_4693ba41.zip


KR Kannan R Syncfusion Team September 7, 2017 12:31 PM UTC

Hi Ronak,  
  
Yes, we have checked the reason for this reported exception from various technical sites. Based on the information we found, the reported problem mostly occurs when trying to access the disposed items. Since it is not happening in the sample provided in our side, please confirm if you are accessing disposed items in your modified sample project.    
  
Also refer to the MSDN Forum link for further reference, and if this does not help, please send us the issue reproducing modified sample to check and provide a prompt solution at the earliest.    
  
Regards,   
Kannan   



EG Emilio Grimaldo June 5, 2019 03:42 PM UTC

Interesting example but the problem is the user can no longer swipe the navigation drawer open.


SP Subburaj Pandian Veluchamy Syncfusion Team June 6, 2019 02:07 PM UTC

Hi Emilio, 
 
We have modified the sample, for open the Navigation Drawer as longer. We just remove the ToggleDrawer() method from itemClick() Method. Please refer the following sample, 
  
  
Please check the sample and let us know if it is helpful. 
 
Regards,
Subburaj Pandian V 


Loader.
Up arrow icon