This is a migrated thread and some comments may be shown as answers.

Toggle Bullet points

1 Answer 91 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 08 Feb 2016, 12:45 PM

Hi,

 I have a richtexteditor and I am programmatically converting a selection to a bulletedlist on button click with

 

RadTextEditor.ChangeListStyle ( ...)

 

This is fine, except I need this to act as a "toggle" in the same way as the normal bullet buttons do using with the built in menu, Word, etc.

I can't find a way to determine whether a selection is already a list, so is this possible?

 

Thanks,

 

Mark

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Feb 2016, 01:52 PM
Hello Mark,

Thank you for writing.

By default, the RichTextEditorRibbonBar offers such toggle buttons to initialize different lists. If you need to do it by clicking your own button at time when the document is displayed, it is recommended to execute a ToggleBulletsCommand. Here is a sample code snippet which result is illustrated the attached gif file:
private void radToggleButton1_ToggleStateChanged(object sender, Telerik.WinControls.UI.StateChangedEventArgs args)
{
    Telerik.WinForms.Documents.RichTextBoxCommands.ToggleBulletsCommand command =
        new Telerik.WinForms.Documents.RichTextBoxCommands.ToggleBulletsCommand(this.radRichTextEditor1.RichTextBoxElement);
    command.Execute();
}

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
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
Tags
RichTextEditor
Asked by
Mark
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or