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

RadRichTextBox

4 Answers 131 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ashrul
Top achievements
Rank 1
Ashrul asked on 27 Apr 2018, 07:14 AM

i m starting to learn WPF right now, and i am a newbie for it.

what i am asking is  i want to make simple program using radrichtextbox like outline view in MS Word, but i have no idea to make it realized, 

i often read Documentation that i have from Telerik, but there is something that i dont understand about it, so would you like to guide me what step that should i do 

to make simple program like this.

actually i want to know, what is document in raddocument type(exp maybe list type, or array type or json)? what can i get the value of paragraph and how to make it in tree visual..

before that, i would like to say thank you and  i hope someone guide me to this.

 

thanks in advanced

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 01 May 2018, 02:10 PM
Hello Ashrul,

To add RadRichTextBox to your application, you will only need to reference the required assemblies and add the control to the XAML:

<telerik:RadRichTextBox x:Name="radRichTextBox" />

If you would like to use the UI that comes with the control, you can drag the RadRichTextBoxRibbonUI control from the toolbox of Visual Studio and drop it over the RadRichTextBox instance in the designer. You can find a complete runnable example containing RadRichTextBox with its complete UI in our SDK repository on GitHub.

As to the RadDocument class, this is a complex object representing the whole document and contains many different properties that describe the content and its styling. You can take a look at the Elements Hierarchy topic to get a better understanding of how the document elements are structured in a RadDocument.

As you could see from the topic describing the hierarchy of the document elements, a Paragraph can contain many types of content, which are not always possible to represent as text value (images, for example). If you need to extract the text of a specific paragraph, you can get the Span elements it contains and check their text:

StringBuilder textInParagraph = new StringBuilder();
foreach (var span in paragraph.EnumerateChildrenOfType<Span>())
{
    textInParagraph.Append(span.Text);
}

The EnumerateChildrenOfType<T>() method is defined in the base DocumentElement class and can be used with any type inheriting this base class. It is pretty useful when you need to obtain all elements of a specific type.

Hope that this information is helpful.

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Ashrul
Top achievements
Rank 1
answered on 03 May 2018, 07:25 AM

thanks for answering my question.

and then what can i make a simple program to detect a level paragraph like MS-Word outline view ?

i have no idea with that..

 

thanks

0
Ashrul
Top achievements
Rank 1
answered on 03 May 2018, 07:32 AM

I m very interisting to learn more...'

btw if any way to detect when user type in radrichtextbox and press Tab ?
what can we know if user type tab in code behid ??

 

thanks

0
Boby
Telerik team
answered on 08 May 2018, 05:52 AM
Hello ashrul,

Navigation pane is currently not supported, and such implementation won't be trivial. You can vote for the feature to increase its priority using the item in our public portal here:
RichTextBox: Add Navigation Pane

To detect pressing of the Tab key, you can use RadRichTextBox.PreviewEditorKeyDown event.

Regards,
Boby
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RichTextBox
Asked by
Ashrul
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Ashrul
Top achievements
Rank 1
Boby
Telerik team
Share this question
or