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
close icon

Ribbon Window Disable Keytip

Hello,

I have been using Syncfusion products for a while. I try to implement a syncfusion ribbon with ribbonwindow in one of my projects. However, there is this problem when i press any button while main window is activated, i get a null reference exception. When i examine stack trace for the exception , I found that this is related to keytips of the ribbon control. I really dont target having QAT or keytips in my application. So is there any way to disable ribbon keytips totally? Below you can find exception details.

Regards,

<code>
System.NullReferenceException was unhandled
  HResult=-2147467261
  Message= NullReferenceException Object Reference not set to an instance of an object
  Source=Syncfusion.Tools.Wpf
  StackTrace:
       konum: Syncfusion.Windows.Tools.Controls.Ribbon.FindKeyTips(Dictionary`2& keyTips, UIElement root)
       konum: Syncfusion.Windows.Tools.Controls.Ribbon.FindKeyTips(Dictionary`2& keyTips, UIElement root)
       konum: Syncfusion.Windows.Tools.Controls.Ribbon.FindKeyTips(Dictionary`2& keyTips, UIElement root)
       konum: Syncfusion.Windows.Tools.Controls.Ribbon.InitializeKeyTips()
       konum: Syncfusion.Windows.Tools.Controls.Ribbon.m_ribbonWindow_KeyDown(Object sender, KeyEventArgs e)
       konum: System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       konum: System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       konum: System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       konum: System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       konum: System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       konum: System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       konum: System.Windows.Input.InputManager.ProcessStagingArea()
       konum: System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       konum: System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       konum: System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
       konum: System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
       konum: System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
       konum: System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
       konum: System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       konum: System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       konum: System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       konum: System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       konum: System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
       konum: System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
       konum: System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
       konum: System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       konum: System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       konum: System.Windows.Application.RunDispatcher(Object ignore)
       konum: System.Windows.Application.RunInternal(Window window)
       konum: System.Windows.Application.Run(Window window)
       konum: System.Windows.Application.Run()
       konum: ConsTracker.App.Main() C:\Users\katli\Documents\Visual Studio 2015\Projects\ConsTracker\ConsTracker\obj\Debug\App.g.cs içinde: satır 0
  InnerException: 
</code>


6 Replies

KA Kemal Atli March 21, 2016 08:44 AM UTC

Actually i figured out that setting e.handled as true solves my null reference exception but, document inside ribbon window wont get focus. Textbox control inside document pane will not type anyting since ribbon window gets all focus. Is there any workaround for this issue?


RG Rajkumar Ganesamoorthy Syncfusion Team March 22, 2016 10:14 AM UTC

Hi Kemal,
Thank you for contacting Syncfusion Support.
Query 1: Document inside ribbon window wont get focus. Textbox control inside document pane will not type anyting since ribbon window gets all focus. Is there any workaround for this issue?
We are analyzed your reported issue from our side. But we were unable to reproduce the reported issue from our side. We can edit the text in TextBox control which is located in RibbonWindow control. So could you please provide more information like issue reproducing sample, it will help us to provide appropriate solution. Please find the sample with which we checked from the following location.
Sample:RibbonWindowTesting

In your reported query you mentioned that setting e.handled as true to avoid null reference exception. Could you please provide more details about this statement like in which event you have set e.handled as true, it will help to provide the appropriate solution for null reference exception on Ribbon controls.
Regards,
Rajkumar G.


AL Alan L replied to Rajkumar Ganesamoorthy September 26, 2017 02:52 PM UTC

Hi Kemal,
Thank you for contacting Syncfusion Support.
Query 1: Document inside ribbon window wont get focus. Textbox control inside document pane will not type anyting since ribbon window gets all focus. Is there any workaround for this issue?
We are analyzed your reported issue from our side. But we were unable to reproduce the reported issue from our side. We can edit the text in TextBox control which is located in RibbonWindow control. So could you please provide more information like issue reproducing sample, it will help us to provide appropriate solution. Please find the sample with which we checked from the following location.
Sample:RibbonWindowTesting

In your reported query you mentioned that setting e.handled as true to avoid null reference exception. Could you please provide more details about this statement like in which event you have set e.handled as true, it will help to provide the appropriate solution for null reference exception on Ribbon controls.
Regards,
Rajkumar G.

I've just had the same issue.  Backtracking I've noticed adding a RibbonSeparator between RibbonBars leads to my null reference on the keytips.

From your example... try adding the RibbonSeparator as shown below.


Exception Detail...

System.NullReferenceException was unhandled

Message: An unhandled exception of type 'System.NullReferenceException' occurred in Syncfusion.Tools.Wpf.dll

Additional information: Object reference not set to an instance of an object.


Call Stack...

> Syncfusion.Tools.Wpf.dll!Syncfusion.Windows.Tools.Controls.Ribbon.FindKeyTips(ref System.Collections.Generic.Dictionary<string, Syncfusion.Windows.Tools.Controls.KeyTip> keyTips, System.Windows.UIElement root) Unknown

  Syncfusion.Tools.Wpf.dll!Syncfusion.Windows.Tools.Controls.Ribbon.FindKeyTips(ref System.Collections.Generic.Dictionary<string, Syncfusion.Windows.Tools.Controls.KeyTip> keyTips, System.Windows.UIElement root) Unknown

  Syncfusion.Tools.Wpf.dll!Syncfusion.Windows.Tools.Controls.Ribbon.FindKeyTips(ref System.Collections.Generic.Dictionary<string, Syncfusion.Windows.Tools.Controls.KeyTip> keyTips, System.Windows.UIElement root) Unknown

  Syncfusion.Tools.Wpf.dll!Syncfusion.Windows.Tools.Controls.Ribbon.InitializeKeyTips() Unknown

  Syncfusion.Tools.Wpf.dll!Syncfusion.Windows.Tools.Controls.Ribbon.m_ribbonWindow_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) Unknown

  PresentationCore.dll!System.Windows.Input.KeyEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Unknown

  PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown

  PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) Unknown

  PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown

  PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown

  PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) Unknown

  PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args, bool trusted) Unknown

  PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() Unknown

  PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) Unknown

  PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) Unknown

  PresentationCore.dll!System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawKeyboardActions actions, int scanCode, bool isExtendedKey, bool isSystemKey, int virtualKey) Unknown

  PresentationCore.dll!System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(ref System.Windows.Interop.MSG msg, ref bool handled) Unknown

  PresentationCore.dll!System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(ref System.Windows.Interop.MSG msg, System.Windows.Input.ModifierKeys modifiers) Unknown

  PresentationCore.dll!System.Windows.Interop.HwndSource.OnPreprocessMessage(object param) Unknown

  WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown

  WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown

  WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown

  WindowsBase.dll!System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority priority, System.Delegate method, object arg) Unknown

  PresentationCore.dll!System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(ref System.Windows.Interop.MSG msg, ref bool handled) Unknown

  PresentationCore.dll!System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(ref System.Windows.Interop.MSG msg, ref bool handled) Unknown

  WindowsBase.dll!System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(ref System.Windows.Interop.MSG msg) Unknown

  WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Unknown

  WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) Unknown

  PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) Unknown

  PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) Unknown

  PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) Unknown

  PresentationFramework.dll!System.Windows.Application.Run() Unknown

  RibbonWindowTesting.exe!RibbonWindowTesting.App.Main() Unknown

  [Native to Managed Transition]

  [Managed to Native Transition]

  mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) Unknown

  Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() Unknown

  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) Unknown

  mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown

  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown

  mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown

  mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Unknown




KJ Keerthana Jegannathan Syncfusion Team September 27, 2017 06:30 AM UTC

  
Hi Alan, 
 
Thank you for contacting Syncfusion support. 
 
We have checked the reported NullReferenceException in Ribbon with our previous sample by including RibbonSeparator between the RibbonBar in latest version(15.3.0.29). But we were unable to reproduce the reported exception in our side. We have modified the sample and prepared video your reference and it can be downloaded from the below location. 
 
 
 
Can you check with the sample and video for the scenario we have checked and let us know if we have misunderstood your query? Also, if possible can you share the version you are currently using and simple application which replicates the issue? 
 
Regards, 
Keerthana J 



RO Roberto June 24, 2018 06:23 PM UTC

I was doing some tests and got same exception.
Tried the sample project and got the null reference exception when i clicked in the minimize ribbon button.

I am using Windows 10 64 bit with latest updates and Visual Studios 2017 with latest updates.

The syncfusion dependencies were downloaded using the syncfusion wpf nuget sources.


GS Gokul Sainarayanan Syncfusion Team June 25, 2018 12:35 PM UTC

Hi Roberto,

We have checked your reported query with our sample application but we were unable to reproduce the reported Null Reference Exception. However we have faced a similar issue in Ribbon when minimize the Ribbon in VS 2017. As it is reproduced specifically in VS 2017, we have analyzed based on this and observed that it is related to VS 2017 debugger. Please refer the MSDN link below

Link: https://developercommunity.visualstudio.com/content/problem/71484/systeminvalidoperationexception-the-visual-tree-ha.html  

Therefore, we suggest you to disable the “Enable UI Debugging Tools for Xaml” in the options of Debug tab. Please check and let us know if it resolves the reported issue.

Regards,
Gokul S

Loader.
Live Chat Icon For mobile
Up arrow icon