RadEditor shows only 50 character from content.

7 posts, 2 answers
  1. Harish
    Harish avatar
    11 posts
    Member since:
    Jun 2015

    Posted 02 Jul 2015 Link to this post

    Hi All,

    I am using RadEditor control n the grid.

    I want to show the only first 50 character content or may be forst row from the content.

    Please help me how to achieve this.

    Thanks,

    Harish Patil

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 06 Jul 2015 Link to this post

    Hello Harish,

    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
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Harish
    Harish avatar
    11 posts
    Member since:
    Jun 2015

    Posted 07 Jul 2015 in reply to Ianko Link to this post

    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

  5. Answer
    Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 08 Jul 2015 Link to this post

    Hello Harish,

    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
    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 Feedback Portal and vote to affect the priority of the items
  6. Harish
    Harish avatar
    11 posts
    Member since:
    Jun 2015

    Posted 12 Jul 2015 in reply to Ianko Link to this post

    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

  7. Answer
    Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 13 Jul 2015 Link to this post

    Hello Harish,

    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
    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 Feedback Portal and vote to affect the priority of the items
  8. Harish
    Harish avatar
    11 posts
    Member since:
    Jun 2015

    Posted 15 Jul 2015 in reply to Ianko Link to this post

    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​

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017