6 Answers, 1 is accepted
Can you provide some more details about the scenario implemented?
Is the editor editable when you need to show the content, or not? Is it used in EditTemplate or InsertTemaplate?
By providing a sample markup of the current implementation will be helpful to define what is the exact scenario.
Regards,
Ianko
Telerik
Hi Lanko,
Actually I have one RadEditor control inside RadGrid.
1. Insert content from RadEditor control in database as per formatting.
Eg. Content Saved in Database: <strong><em><span style="font-size: 20px; text-decoration: underline; color: #ff0000; background-color: #ffc000;">WOW <span style="color: #000000; background-color: #ffffff;">12356432569874563215346985763259874561235478965324</span></span></em></strong>
2. After grid binding data is showing as formatting with GridBoundColumn. (Bold, Italic, Underline, Font)
<telerik:GridBoundColumn UniqueName="Content" HeaderText="Content" DataField="Content">
<HeaderStyle Width="60px"></HeaderStyle>
</telerik:GridBoundColumn>
3. Now when grid gets bind with formatted content I want to bind only first 50 character. And after when I will click on specific grid row then grid will be in Edit Mode. That time all content will show.
If you need more information ?
Can you please tell me how to achieve above scenario ?
Thanks,
Harish Patil
The best way to implement that is to have two columns in the database—one with the review of text and second with teh full text.
Programmatically, the GridColumn to be bound with the review field, and in Edittemplate, RadEditor to the full content. Subsequently, upon saving content, update programmatically both full text and review text in the database.
Regards,
Ianko
Telerik
Hi Lanko,
Thanks for the suggestion. It will work for me.
But I am using following code, How I can save the only 50 characters in second field(review) ?
With the following code I am getting HTML format code but how to get from HTML 50 characters ?
Coz those 50 characters also should be formatted.
Code:
obj.Content = string.IsNullOrEmpty((formItem.FindControl("txtContent") as RadEditor).Content) ? string.Empty : (formItem.FindControl("txtContent") as RadEditor).Content;
Thanks,
Harish Patil
There is no built-in option to achieve that. This should be implemented via custom logic that traverses the HTML, gather the needed amount of text and generate a valid HTML output.
This is purely a programmatic task that should be designed and built from scratch. I cannot suggest you a ready-to-use solution for this situation.
Regards,
Ianko
Telerik
Hi Lanko,
Thanks, I have resolved the issue as per your suggestion.
Solution: The best way to implement that is to have two columns in the database—one with the review of text and second with teh full text.
Thanks,
Harish Patil