5 Answers, 1 is accepted
0
Hi Nathan,
I just created a new KB Article regarding your question: Adding and using contextual groups in radRibbonBar
Please review it and see if it helps. If the information in the KB Article is not sufficient I will be happy to assist you.
Kind regards,
Jordan
the telerik team
I just created a new KB Article regarding your question: Adding and using contextual groups in radRibbonBar
Please review it and see if it helps. If the information in the KB Article is not sufficient I will be happy to assist you.
Kind regards,
Jordan
the telerik team
0

DukeVideo
Top achievements
Rank 1
answered on 02 Mar 2007, 06:56 AM
Hi Jordan,
Thank you very much for the KB Article. Unfortunately, I can't figure out what the context of 'this' is, so am unsure about where the properties 'contextualTabsSelection' and 'richEditorToolWindow' are exposed. However, your code does look very much like mine:
The problem being with this is that setting contextualTabGroup.Visibility to anything results in a NullReferenceException ...
Even though, both the contextualTabGroup and ElementVisibility items are not null. By the way, the first code block is at the following position in the stack trace:
ProgramX.nTier.WinForms.nTierTool.UI.TabFactory.nTierConfigFileTab_TabRaised(Object sender, EventArgs e) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\TabFactory.cs:line 44
I am running 2006 Q4 SP 2.
A very attractive product! Just hope I can make my app work as well as Word 2007!
Thank you very much for the KB Article. Unfortunately, I can't figure out what the context of 'this' is, so am unsure about where the properties 'contextualTabsSelection' and 'richEditorToolWindow' are exposed. However, your code does look very much like mine:
foreach (ContextualTabGroup contextualTabGroup in RadRibbonBar.ContextualTabGroups) |
{ |
contextualTabGroup.Visibility=ElementVisibility.Collapsed; |
} |
foreach (ContextualTabGroup contextualTabGroup in RadRibbonBar.ContextualTabGroups) |
{ |
if (contextualTabGroup.Tag=="nTierConfig") |
{ |
contextualTabGroup.Visibility=ElementVisibility.Visible; |
// display contextual tabs on ribbon bar |
MessageBox.Show("Dissplay"); |
} |
} |
The problem being with this is that setting contextualTabGroup.Visibility to anything results in a NullReferenceException ...
System.NullReferenceException was unhandled |
Message="Object reference not set to an instance of an object." |
Source="Telerik.WinControls.UI" |
StackTrace: |
at Telerik.WinControls.UI.ContextualTabGroup.OnPropertyChanged(RadPropertyChangedEventArgs e) |
at Telerik.WinControls.RadObject.UpdateEffectiveValue(RadProperty dp, RadPropertyMetadata metadata, Boolean isCoerceValue, Boolean isOldValueValid, Object oldValue, ValueSource oldValueSource, Boolean oldValueIsDeferred, Boolean coerceWithDeferredReference) |
at Telerik.WinControls.RadObject.SetValueCommon(RadProperty dp, Object value, RadPropertyMetadata metadata, Boolean coerceWithDeferredReference) |
at Telerik.WinControls.RadObject.SetValue(RadProperty dp, Object value) |
at Telerik.WinControls.RadElement.set_Visibility(ElementVisibility value) |
at ProgramX.nTier.WinForms.nTierTool.UI.TabFactory.nTierConfigFileTab_TabRaised(Object sender, EventArgs e) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\TabFactory.cs:line 44 |
at ProgramX.nTier.WinForms.nTierTool.UI.TabbedDocument.OnTabRaised(EventArgs e) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\TabbedDocument.cs:line 45 |
at ProgramX.nTier.WinForms.nTierTool.UI.Tabs.NTierConfigFileTab.OnTabRaised(EventArgs e) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\Tabs\NTierConfigFileTab.cs:line 67 |
at ProgramX.nTier.WinForms.nTierTool.UI.TabbedDocument.Select(RadTabStrip radTabStrip) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\TabbedDocument.cs:line 58 |
at ProgramX.nTier.WinForms.nTierTool.UI.TabFactory.CreateNTierConfigFileTab(RadTabStrip parentRadTabStrip) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\TabFactory.cs:line 28 |
at ProgramX.nTier.WinForms.nTierTool.MainWindow.NewNTierConfigTab() in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\MainWindow.cs:line 32 |
at ProgramX.nTier.WinForms.nTierTool.MainWindow.radToolbarButtonNewNTierConfig_Click(Object sender, EventArgs e) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\MainWindow.cs:line 26 |
at Telerik.WinControls.RadItem.OnClick(EventArgs e) |
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e) |
at Telerik.WinControls.RadItem.DoClick(EventArgs e) |
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) |
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) |
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args) |
at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args) |
at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e) |
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e) |
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) |
at System.Windows.Forms.Control.WndProc(Message& m) |
at System.Windows.Forms.ScrollableControl.WndProc(Message& m) |
at Telerik.WinControls.RadControl.WndProc(Message& m) |
at Telerik.WinControls.UI.RadRibbonBar.WndProc(Message& m) |
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) |
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) |
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) |
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) |
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) |
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) |
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) |
at System.Windows.Forms.Application.Run(Form mainForm) |
at ProgramX.nTier.WinForms.nTierTool.Program.Main() in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\Program.cs:line 18 |
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) |
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) |
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() |
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) |
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) |
at System.Threading.ThreadHelper.ThreadStart() |
Even though, both the contextualTabGroup and ElementVisibility items are not null. By the way, the first code block is at the following position in the stack trace:
ProgramX.nTier.WinForms.nTierTool.UI.TabFactory.nTierConfigFileTab_TabRaised(Object sender, EventArgs e) in C:\Documents and Settings\pledn\My Documents\Visual Studio 2005\Projects\nTierTool\nTierTool\UI\TabFactory.cs:line 44
I am running 2006 Q4 SP 2.
A very attractive product! Just hope I can make my app work as well as Word 2007!
0

DukeVideo
Top achievements
Rank 1
answered on 02 Mar 2007, 07:17 AM
Actually Jordan, I have just got it working.
I don't know, but I think it might have been a bug.
Basically, I selected the contextual tab group from the Property list at the top of the Property inspector. This displayed the red dotted surround at the top left of the form (not where it should have been), but was otherwise invisible. I checked the Visibility property in the inspector, and it was set to "Visible". I thought I'd try and toggle it, and got a similar exception as before - when my code was running.
So, I killed the tab and started again. All working fine.
I don't know, but I think it might have been a bug.
Basically, I selected the contextual tab group from the Property list at the top of the Property inspector. This displayed the red dotted surround at the top left of the form (not where it should have been), but was otherwise invisible. I checked the Visibility property in the inspector, and it was set to "Visible". I thought I'd try and toggle it, and got a similar exception as before - when my code was running.
So, I killed the tab and started again. All working fine.
0
Hi Nathan,
It seems you have stumbled upon a problem with contextual groups. We will very much appreciate it if you open a support ticket and send us a simple project that demonstrates the problem so we can examine it more closely and resolve it. Thanks in advance.
Regards,
Jordan
the telerik team
It seems you have stumbled upon a problem with contextual groups. We will very much appreciate it if you open a support ticket and send us a simple project that demonstrates the problem so we can examine it more closely and resolve it. Thanks in advance.
Regards,
Jordan
the telerik team
0

DukeVideo
Top achievements
Rank 1
answered on 02 Mar 2007, 09:29 AM
I'll certainly have a go. Might be in a couple of days time, as we're currently quite busy. Keen to help out, though.