This question is locked. New answers and comments are not allowed.
Hi,
Our telerik dlls all have the version: 2011.3.1323.1040
I am trying to implement the printing example that uses RadRichTextBox found here:
http://demos.telerik.com/silverlight/#GridView/PrintAndExportWithRadDocument
I am getting an exception when I try to add the RadRichTextBox as a child to the parent of the RadGridView. I have simplified my code so as to more clearly demonstrate the error.
Here is the XAML:
Our telerik dlls all have the version: 2011.3.1323.1040
I am trying to implement the printing example that uses RadRichTextBox found here:
http://demos.telerik.com/silverlight/#GridView/PrintAndExportWithRadDocument
I am getting an exception when I try to add the RadRichTextBox as a child to the parent of the RadGridView. I have simplified my code so as to more clearly demonstrate the error.
Here is the XAML:
<telerikGrid:RadGridView x:Name="RadGridView1"></telerikGrid:RadGridView><telerik:RadButton x:Name="PrintButton" Content="Print" Click="PrintButton_Click" />
And here is the click event handler:private void PrintButton_Click(object sender, RoutedEventArgs e) { Grid parent = RadGridView1.ParentOfType<Grid>(); var tb = new TextBox() { Height = 0 }; tb.Name = "NormalTextBox"; parent.Children.Add(tb); // works fine var rtb = new RichTextBox() { Height = 0 }; rtb.Name = "NormalRichTextBox"; parent.Children.Add(rtb); // works fine var rb = new RadButton(); rb.Name = "RadButton1"; parent.Children.Add(rb); // works fine RadRichTextBox rrtb = new RadRichTextBox() { Height = 0 }; rrtb.Name = "RadRichTextBox1"; parent.Children.Add(rrtb); // exception thrown here! }
I included cases that work fine so you can more easily see the contrast.
The exception has the message: "Error HRESULT E_FAIL has been returned from a call to a COM component."
The stack trace is:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
at System.Windows.PresentationFrameworkCollection`1.Add(T value)
at Pmc.Views.Controls.ManufacturingStylesControl.PrintButton_Click(Object sender, RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Please help if you can!!
Thanks,
Mike Maddux