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

Select/highlight one row at a time.

3 Answers 78 Views
Editor
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 05 May 2010, 02:43 AM
When selecting/highlighting all text then bold / change font  etc. the entire text is quite rightly wraped with start and end tags.
What i want to do is wrap each line with the text change.
Reason being i am treating each carriage return or new line as an entry. If user selects the lot i need each line tagged not the lot.
Can i stop users from selecting the whole text can select one line only.


3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 May 2010, 02:29 PM
Hi Mike,

The content area of RadEditor is an editable IFRAME element which uses the Rich Text Editing engine of the browser and its commands to apply formatting to the selected content.

I made a test by selecting the whole content with Ctrl+A and applying bold formatting and saw that the browser applied the strong tags to every line individually, e.g.

Original Content
<p>line1</p>
<p>line2</p>
<p>line3</p>


Produced Content after the bold command execution:
<p><strong>line1</strong></p>
<p><strong>line2</strong></p>
<p><strong>line3</strong></p>

Please, note that this is a browser behavior and we cannot override it, because this will cause different unwanted side effects.


Kind regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
mike
Top achievements
Rank 1
answered on 06 May 2010, 12:23 AM
I did same test how ever with different result - i highlighted with mouse and another test cntrl a.

before bold
a<br />
b<br />
c<br />
d

after bold
<strong>a<br />
b<br />
c<br />
d</strong>
0
Rumen
Telerik team
answered on 06 May 2010, 08:36 AM
Hello Mike,

The browser applies the bold formatting per paragraph and for that reason my recommendation is to set the NewLineBr property of RadEditor to false. Therefore the editor will insert a paragraph tag when the enter key is pressed and each selected new line will be wrapped in a strong tag when the bold command is executed.

There is not workaround when there are <br/> tags in the content, because the browser handles the Bold command.

Best regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
mike
Top achievements
Rank 1
Answers by
Rumen
Telerik team
mike
Top achievements
Rank 1
Share this question
or