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

How do I... use a user-control which contains the RibbonView with multiple RTB instances?

1 Answer 68 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aron
Top achievements
Rank 1
Aron asked on 26 Jan 2012, 04:06 PM
I have created a RibbonView from the example on your site, and added it to a user control.  The naming conventions match the example exactly.

I want to programmatically (using C#) add this control to a grid and have it work with an RTB that is also programmatically added to the grid.  Currently I cannot get them to talk to each other.  I would also like to be able to add multiple RTB's to the page and have the control switch dynamically.  I've seen a demo written for WPF, but as the RibbonView is not within the same context I don't know how to adapt it.

My example C# is as follows:

//define an int to be used as a flag if the ribbon has been added.
private int editorLoaded = 0; 

while
 (sNodeName == "Tab")
{
    if
 (editorLoaded == 0)
    {     editorLoaded = 1;
         UI.Controls.xRichTextRibbon xRibbon = new UI.Controls.xRichTextRibbon();
         xRibbon.Margin = new Thickness(15, 15, 15, 15);
         grdEdit.Children.Add(xRibbon);
    }

    RadRichTextBox editor = new RadRichTextBox();
    editor.Document.LayoutMode = Telerik.Windows.Documents.Model.DocumentLayoutMode.Flow;
    editor.Height = 300;
    editor.Margin = new Thickness(15, 115, 15, 15);
    editor.VerticalAlignment = System.Windows.VerticalAlignment.Top;
    editor.IsReadOnly = false;

    grdEdit.Children.Add(editor);
}

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 31 Jan 2012, 12:37 PM
Hello Aron ,

 I guess you need RadRichTextBoxRibbonUI instead of RibbonView. Could you please check out this demo and its source code and let us know if it helps you ? You can also find this help article useful.
On a side note, we highly encourage you to use XAML (not c#) when defining your UI.

Regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RibbonView and RibbonWindow
Asked by
Aron
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or