i am using the radrichtextbox on my application. application is when i click on button on radwindow will appear and and user can enter text over their. and click on save text will save. and when he open next same text with same format we will get .
but i am unable to get the radrichtextbox on my application.
code:
<telerik:RadRichTextBox x:Name="radRichTextBox" Width="500" Height="500" CurrentSpanStyleChanged="radRichTextBox_CurrentSpanStyleChanged" Margin="2,0,2,-189" Grid.Row="1">
<telerik:RadDocument LayoutMode="Paged">
<telerik:Section PageMargin="10, 10, 10, 10">
<telerik:Paragraph TextAlignment="Center">
<telerik:Span Text="Thank you for choosing Telerik" />
<telerik:Span FontWeight="Bold" Text=" RadRichTextBox!" />
</telerik:Paragraph>
<telerik:Paragraph>
<telerik:Span FontWeight="Bold" Text="RadRichTextBox" />
<telerik:Span Text=" is a control that is able to display and edit rich-text content including formatted text arranged in pages, paragraphs, spans (runs) etc." />
</telerik:Paragraph>
<telerik:Table LayoutMode="AutoFit" StyleName="TableGrid">
<telerik:TableRow>
<telerik:TableCell>
<telerik:Paragraph>
<telerik:Span Text="Cell 1" />
</telerik:Paragraph>
</telerik:TableCell>
<telerik:TableCell>
<telerik:Paragraph>
<telerik:Span Text="Cell 2" />
</telerik:Paragraph>
</telerik:TableCell>
</telerik:TableRow>
<telerik:TableRow>
<telerik:TableCell ColumnSpan="2">
<telerik:Paragraph>
<telerik:Span Text="Cell 3" />
</telerik:Paragraph>
</telerik:TableCell>
</telerik:TableRow>
</telerik:Table>
<telerik:Paragraph/>
</telerik:Section>
</telerik:RadDocument>
</telerik:RadRichTextBox>
can u plz provide a sample code which help me to do above application.
9 Answers, 1 is accepted
You can check the sample code from the demo applications and the SDK examples on github.
All the best,
Boby
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
<UserControl x:Class="CustomizePresentation.Example"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common"
xmlns:demo="clr-namespace:CustomizePresentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<telerikQuickStart:QuickStart.ExampleHeader>
<TextBlock Text="Customize Presentation" Margin="8" />
</telerikQuickStart:QuickStart.ExampleHeader>
<telerikQuickStart:QuickStart.ConfigurationPanel>
<StackPanel Margin="3">
<CheckBox x:Name="checkBoxHighlightCurrentWord" Margin="2" Checked="checkBoxHighlightCurrentWord_Checked" Unchecked="checkBoxHighlightCurrentWord_Unchecked">
<TextBlock Text="Highlight Current Word" />
</CheckBox>
<CheckBox x:Name="checkBoxHighlightCurrentLine" Margin="2" Checked="checkBoxHighlightCurrentLine_Checked" Unchecked="checkBoxHighlightCurrentLine_Unchecked">
<TextBlock Text="Highlight Current Line" />
</CheckBox>
</StackPanel>
</telerikQuickStart:QuickStart.ConfigurationPanel>
<telerik:RadRichTextBox x:Name="editor" IsSpellCheckingEnabled="False" />
</UserControl>
The QuickStart elements are only used in the online examples, so that the whole application can be put together. The assembly they are in is not distributed, that is why you are getting an error.
If you remove the quick start elements and the declaration of the namespace, you should be able to run the project. For more information on getting started, please check this article. For examples which you can run right away, provided that you have installed the controls you can refer to the SDK examples on github which Boby mentioned.
Iva Toteva
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
by sample examples code from SDK examples on github , now i can able to get the radRichtextbox. but the problem is when we use the dll from the Binaries folder instead of that i when i use from the folder Binaries.NoXaml its working fine.
the problem was with the version which we are using previously. for the version 2013.1.220.1050 i can able to do this.
error: which i was getting by using the dll's binaries is,
"at Telerik.Windows.Controls.RichTextBoxUI.DocumentRulerBase.GetTemplateChild[T](String controlName)
at Telerik.Windows.Controls.RichTextBoxUI.DocumentRulerBase.OnApplyTemplate()
at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)"
may i know why i am facing this problem.
Any Update ?
i want to take a button on above example and when i click that the previous entered text i want to featch .. how can i do this ? code same i used in the sample.
The binaries from Binaries.NoXaml doesn't contain XAML and could be used as described in this article - basically you should add the needed control styles as XAML files or from the precompiled theme binaries. You can get the content of the RadRichTextBox using the TxtFormatProvider.
Greetings,
Boby
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I Understand that Binaries.NoXaml doesn't contain XAML. For implicit styling we reference the Telerik assemblies from Binaries.NoXaml folder. However, RadDocument with RichTextBox doesn't work with these referenced assemblies. Please provide fix for this ASAP. This is very critical for us.
Thanks,
Swetha
Please find attached a project wired to use NoXaml binaries as per the article Boby referenced and more precisely, this part. The relevant code (for styling) is in the App.xaml file.
In case this does not work on your end, please get back to us with additional details.
Greetings,
Petya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.