Detecting Bulleted and Numbered

9 posts, 1 answers
  1. Karlkim Suwanmongkol
    Karlkim Suwanmongkol avatar
    41 posts
    Member since:
    Aug 2012

    Posted 03 Dec 2010 Link to this post

    From the code, I can toggle some buttons like bold, italic, or subscript by checking the appropriated Style's property values. However, I could not figure out where to check if the highlighted text have been bulleted or numbered. Could you point me where I could find the information?

    Thanks,
    Karlkim
  2. Answer
    Boby
    Admin
    Boby avatar
    595 posts

    Posted 07 Dec 2010 Link to this post

    Hello Karlkim Suwanmongkol,
    The easiest way to update buttons' states is to handle the events that each of the RadRichTextBox's commands raises.
    • This could be the XAML, here you bind buttons to appropriate commands:
      <telerik:RadToggleButton x:Name="bulletListButton" Command="{Binding ElementName=richTextBox, Path=Commands.ToggleBulletsCommand}" ...
      </telerik:RadToggleButton >
      <telerik:RadToggleButton x:Name="numberedListButton" Command="{Binding ElementName=richTextBox, Path=Commands.ToggleNumberedCommand}" ...
      </telerik:RadToggleButton >
    • and this - the code behind. Here you handle command's event to update the state of the control:
      public MainPage()
      {
          InitializeComponent();
        
          this.richTextBox.Commands.ToggleBulletsCommand.ToggleExecuted += (s, e) => { this.bulletListButton.IsChecked = e.NewValue; };
          this.richTextBox.Commands.ToggleNumberedCommand.ToggleExecuted += (s, e) => { this.numberedListButton.IsChecked = e.NewValue; };
      }
    The same approach could be used with other buttons too.
    Don't hesitate to contact us if you have other questions.

    Regards,
    Boby
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Karlkim Suwanmongkol
    Karlkim Suwanmongkol avatar
    41 posts
    Member since:
    Aug 2012

    Posted 07 Dec 2010 Link to this post

    Hi Boby,
       I am sorry for the confusion. Actually, what I want is to be able to detect if the highlighted text is numbered or bulleted or not, so I could toggle the buttons on the fly. Here is the example that I find for "Bold", http://www.telerik.com/help/silverlight/radrichtextbox-features-working-with-radrichtextxbox.html#Current_Span.

    I would like to do the similar thing for bulleted and numbered.

    Thanks,
    karlkim
  5. Boby
    Admin
    Boby avatar
    595 posts

    Posted 09 Dec 2010 Link to this post

    Hi Karlkim Suwanmongkol,
    The value of the CurrentEditingStyle doesn't fit your needs, because it only shows the style under the current position, and not for the whole selection. For example, if you select 2 words, one of them bold and one not, CurrentEditingStyle will report bold or not, depending in which word current position is.
    The easiest way to implement the correct behavior in this case is the one I outlined previously. Actually this is what we use behind the scenes in RadRichTextBoxRibbonUI - as you can read here. We will consider extending the approach specified in the help article you refer for the next realease.

    Please get back to us if this doesn't help.

    Kind regards,
    Boby
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  6. Sasireka
    Sasireka avatar
    17 posts
    Member since:
    Nov 2012

    Posted 20 Jun 2013 Link to this post

    Hi Boby,

    I am also need to apply bullets and numbering to rich text box. I tried the below way but i am getting error as "does not contain a definition of ToggleExecuted" And i am having only "ToggleStateChanged" event. Could you please guide on how to avoid this issue also which namespace we have to use for this.


    Regards,
    Sasireka
  7. Boby
    Admin
    Boby avatar
    595 posts

    Posted 21 Jun 2013 Link to this post

    Hi Sasireka,
    This thread is rather old. The approach is described in this help article.

    Regards,
    Boby
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Sasireka
    Sasireka avatar
    17 posts
    Member since:
    Nov 2012

    Posted 21 Jun 2013 Link to this post

    Hi Boby,

    I got it. Thank you so much for your help.

    Regards,
    Sasireka
  9. Sasireka
    Sasireka avatar
    17 posts
    Member since:
    Nov 2012

    Posted 21 Jun 2013 Link to this post

    Hi Boby,

    I got it. Thank you so much for your help. :)

    Regards,
    Sasireka
  10. Sasireka
    Sasireka avatar
    17 posts
    Member since:
    Nov 2012

    Posted 04 Jul 2013 Link to this post

    Hi Boby,

    We are using Rad rich text box with bullets and numbering format. The bullets and numbering format not copied by using Ctrl + A and Ctrl + V.
    Steps to replicate issue:
    1. select the numbering text  by using Ctrl + A.
    2. Press on Ctrl + X
    3. Then press on Ctrl + V. Now the control displayed only the text not displayed the numbering / bullet format.

    I want to display the format also like ms word doc.. Please share if any code available..

    Regards,
    Sasireka
Back to Top
DevCraft banner