how to break paragraph into different paragraph ?

6 posts, 0 answers
  1. Sopan
    Sopan avatar
    34 posts
    Member since:
    May 2012

    Posted 29 Aug 2013 Link to this post

    Hi,

    I want to divide the current selected paragraph into three different parts as paragraph. 
    I have selected to words from the paragraph so, first paragraph is start position of original paragraph up to end position of selected word after then I want to insert new empty DocumentElement as Paragraph or Table. After then third paragraph as remaining words from the original paragraph.

    How to do this.

    see attached image for more details about functiopnality.

    Thanks
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 02 Sep 2013 Link to this post

    Hello Sopan,

    The desired result can be achieved by creating a DocumentFragment of the content you wish to insert as "middle" paragraph and inserting it at the selection end position as follows:
    if (!this.radRichTextBox.Document.Selection.IsEmpty)
    {
        RadDocument doc = new RadDocument();
        Section section = new Section();
        Paragraph p = new Paragraph();
        p.Inlines.Add(new Span("Some text in new paragraph"));
        section.Blocks.Add(p);
        doc.Sections.Add(section);
     
        DocumentFragment fragment = new DocumentFragment(doc);
     
        this.radRichTextBox.Document.CaretPosition.MoveToPosition(this.radRichTextBox.Document.Selection.Ranges.First.EndPosition);
        this.radRichTextBox.Insert(FormattingSymbolLayoutBox.ENTER);
        this.radRichTextBox.InsertFragment(fragment);
    }

    I hope this helps! Let us know if you have further comments or questions.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sopan
    Sopan avatar
    34 posts
    Member since:
    May 2012

    Posted 11 Sep 2013 Link to this post

    Hi Petya,

    Add Visibility property to DocumentElement in your next version of wpf Control if possible.

    Thanks
    Sopan Vaidya
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 13 Sep 2013 Link to this post

    Hello Sopan,

    Thank you for your feedback!

    Unfortunately, implementing a Visibility property of document elements or providing any other way to collapse them is not considered at this point.

    Let us know if you have other comments or questions.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Sopan
    Sopan avatar
    34 posts
    Member since:
    May 2012

    Posted 13 Sep 2013 Link to this post

    Hi Petya

    Thanks for replayed

    Actually I am trying to implement a functionality like region in Visual studio which allow to collapse and expand the internal code within his limit
    with the help of RadRichTextBox control, but such property or function is not available in RadRichTextBox. If you allow such property that is Visibility property to DocumentElement then this is possible.

    Recently I am trying to implement such functionality, if you have any solution to implement same then please help me or try to implement in your next version rad controls.

    Thanks
    Sopan
  7. Petya
    Admin
    Petya avatar
    975 posts

    Posted 17 Sep 2013 Link to this post

    Hi Sopan,

    As discussed in several of the other forum threads you opened on the topic implementing collapsible regions in RadRichTextBox is currently not possible. While I understand that exposing a Visibility property will allow you to implement your scenario we have no immediate plans for such functionality. Overall, collapsing parts of a document is a rather complex task as opposed to the client demand for it and I cannot tell if or when it might be available.

    Do not hesitate to contact us if you have any other questions.

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready