This is a migrated thread and some comments may be shown as answers.

use radrichtextbox

9 Answers 111 Views
This is a migrated thread and some comments may be shown as answers.
Shweta
Top achievements
Rank 1
Shweta asked on 08 Mar 2013, 11:18 AM
hello,

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

Sort by
0
Boby
Telerik team
answered on 12 Mar 2013, 02:56 PM
Hi Shweta,
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.

0
Shweta
Top achievements
Rank 1
answered on 13 Mar 2013, 07:20 AM
I copied the xaml from first look demo.  When I execute, the radrichtextbox does not show.  not able to use  telerikQuickStart:QuickStart.ExampleHeader also causing error.

<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>
0
Iva Toteva
Telerik team
answered on 13 Mar 2013, 08:46 AM
Hello Shweta,

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.

Kind regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Shweta
Top achievements
Rank 1
answered on 13 Mar 2013, 11:40 AM
Thanks telerik,

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.
0
Shweta
Top achievements
Rank 1
answered on 14 Mar 2013, 08:44 AM
hello,
Any Update ?
0
Shweta
Top achievements
Rank 1
answered on 15 Mar 2013, 08:58 AM
hi,

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. 
0
Boby
Telerik team
answered on 18 Mar 2013, 07:33 AM
Hello Shweta,
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.

0
Mallikarjun
Top achievements
Rank 1
answered on 18 Mar 2013, 09:52 AM
Hi,

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

0
Petya
Telerik team
answered on 20 Mar 2013, 04:01 PM
Hi 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.

Asked by
Shweta
Top achievements
Rank 1
Answers by
Boby
Telerik team
Shweta
Top achievements
Rank 1
Iva Toteva
Telerik team
Mallikarjun
Top achievements
Rank 1
Petya
Telerik team
Share this question
or