Navigation drawer opening when clicking on contentviewer panel not on toggle button

I think i read this before in this forum, on the navigation drawer opening while following the pointer if it is near the position of the navigation drawer. Is there a way of restricting the opening and closing the navigation drawer using just a toggle button and not be triggered by mouse movement or hover?

5 Replies 1 reply marked as answer

VR Vijayalakshmi Roopkumar Syncfusion Team February 5, 2021 11:00 AM UTC

Hi JP 
 
Thank you for contacting Syncfusion Support. 
 
As per your update, we understood that you just want to restrict opening and closing of NavigationDrawer on mouse movements and to want to open and close the navigation drawer just by toggle button. In order to restrict this behavior,  we need to use the following code. 
 
Code: [C#] 
 
 
var filter = navigationDrawer1.GetType().GetField("filter", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); 
dynamic navigationDrawerMouseMessageFilter = filter.GetValue(navigationDrawer1); 
NavigationDrawerMouseMessageFilter MouseMessageFilter = navigationDrawerMouseMessageFilter; 
Application.RemoveMessageFilter(MouseMessageFilter); 
 
 
 
Please find the sample for the same: 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 


Marked as answer

JP JP February 6, 2021 02:59 PM UTC

Thanks! Just what i needed. Appreciate the help.


EM Elakkiya Muthukumarasamy Syncfusion Team February 8, 2021 05:27 AM UTC

Hi JP, 

Thanks for the update. We are glad to know that the issue is resolved at your end. Also, please let us know if you require any further assistance on this. As always, we will be happy to assist you. 

Regards, 
Elakkiya 



UN Unknown replied to Vijayalakshmi Roopkumar February 8, 2022 12:23 AM UTC

Do you have a VB sample for the same?



SA Sulthan Amanu Syncfusion Team February 8, 2022 10:42 AM UTC

Hi Greg,

Please find your requested VB sample and Code snippet in the attachments.

VB code

 

 Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles buttonAdv1.Click

                                                If Not Me.navigationDrawer1.IsDrawerShowing() Then

                                                                Me.navigationDrawer1.ToggleDrawer()

                                                                Me.buttonAdv1.Text = "Collapse"

                                                Else

                                                                Me.navigationDrawer1.ToggleDrawer()

                                                                Me.buttonAdv1.Text = "Expand"

                                                End If

                                End Sub

 



please let us know if you require any further assistance on this. As always, we will be happy to assist you.

Regards,
Sulthan amanu

Attachment: Visual_Basic_Sample_b8721376.zip

Loader.
Up arrow icon