locked
RichEditBox

    Question

  • Hi,

    I have a writing Notes kind of UI, I am using RichEditBox. In this I am trying to paste text from other sources which having bullets, numbers paragraphs etc. After that I am saving the richeditbox text into a local settings.

    When I load the same text from local settings I am not able to see exact format of the text which I pasted into RichEditBox earlier, means the bullet points are not coming only its displaying the plain text.

    I am using the below code for saving text and retrieving text to RichEditBox

    string description = "";
                    descriptiontxtbx.Document.GetText(TextGetOptions.None, out description);

    For retrieving

    descriptiontxtbx.Document.SetText(TextSetOptions.None, description);

    Here I tried to use rtf TextGetOptions but when I retrieve the text to RichEditBox the text is displaying as plain text the bullet points , font sized are not applying.

    Can anyone help me how to save the RichEditBox text to local string with out loosing the bullets and other text formats etc.

    Wednesday, December 24, 2014 2:20 PM

Answers

  • Hi Narendra,

    I create a really simple demo, here I have two RichTextBox and also a button, when I click the button, I copy the text also the style from first RichTextBox to the second one.

            private void Button_Click(object sender, RoutedEventArgs e)
            {
                string description = "";
                descriptiontxtbx.Document.GetText(TextGetOptions.FormatRtf, out description);
    
                descriptiontxtbx1.Document.SetText(TextSetOptions.FormatRtf, description);
            }

    It looks good. However I'm not sure how you make the bullets since when I copy the bullets from word to my app, the bullets changed to dots automatically.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 25, 2014 5:52 AM
    Moderator

All replies

  • Hi Narendra,

    I create a really simple demo, here I have two RichTextBox and also a button, when I click the button, I copy the text also the style from first RichTextBox to the second one.

            private void Button_Click(object sender, RoutedEventArgs e)
            {
                string description = "";
                descriptiontxtbx.Document.GetText(TextGetOptions.FormatRtf, out description);
    
                descriptiontxtbx1.Document.SetText(TextSetOptions.FormatRtf, description);
            }

    It looks good. However I'm not sure how you make the bullets since when I copy the bullets from word to my app, the bullets changed to dots automatically.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, December 25, 2014 5:52 AM
    Moderator
  • Thanks for your reply Jamles, It is fixed ater usinf TextGetOptions.FormatRtf.

    I have another issue

     If you copy bulleted text from word and pasting it into richeditbox its working fine but when you copy bulleted text from a website, it is pasting as a plain text.

    Do we have any way to overcome this issue. This feature is very important, because the users will copy text from websites only.

    Thanks,

    Narendra M



    Saturday, January 3, 2015 7:40 PM
  • Hi Narendra,

    Please open another question for your issue :)

    However I cannot reproduce the issue you mentioned.

    Here I wrote some test bulleted text here and paste on the RichEditBox, it still works fine.

    • test words
    • test words
    • test words

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 7, 2015 9:55 AM
    Moderator