How to interact with DocumentPanes?

2 posts, 0 answers
  1. Robert
    Robert avatar
    271 posts
    Member since:
    Mar 2011

    Posted 14 May 2012 Link to this post

    Good evening,

    This may be a bit of a noob question but how does one interact with RadDocumentPane from a main window?

    Let me detail my Situation.

    My main window contains a RadDockingControl. The RadDockingControl has an area for a DocumentHost.
            <telerikDocking:RadPaneGroup x:Name="radDockingDocumentHost" />

    In Code Behind I programmatically add RadDocumentPanes to the DocumentHost whenever a button is pressed.
    private void btnBlankNewOrder_Click(object sender, RoutedEventArgs e)
        //ADD NEW DOCUMENT PANE _ RadRichTextBox
        var pane = new RadRichTextBoxAutoComplete(products);
        pane.Title = "Rob's Test Pane";

    The RadDocumentPanes being added are a modified UseControl which now inherits the RadDocumentPane.
    <telerik:RadDocumentPane x:Class="TAS2.RadRichTextBoxAutoComplete"
    .................MY CONTROL CONTENT HERE (Cut Out for this Example) ...................

    Each RadDocumentPane hosts a Grid (actually there are nested Grids which have been cut out for this example) that contain a RadRichTextBox.
    <telerik:RadDocumentPane x:Class="TAS2.RadRichTextBoxAutoComplete" ..... >
                        <ColumnDefinition />
                        <ColumnDefinition />
                    <!-- RichTextBox -->
                    <telerik:RadRichTextBox x:Name="radRichTextBox" AcceptsReturn="True" Width="800" Margin="10" Padding="10" Grid.Column="0"
                                            FontSize="14" IsSpellCheckingEnabled="False" DocumentInheritsDefaultStyleSettings="True" />

    Going back to my Main Window that contains the main RadDocking control, I have a Ribbon menu containing several buttons (see the attached image).

    How do I interact with the programatically added RadDocumentPanes and their respective RichTextBox's when pressing a button in the Ribbon menu?

    For example, suppose that the ribbon bar contains a "Paste" button. How do I make the "Paste" command associate itself with the RichTextBox of the current DocumentPane in view?

    I would attach samples of my code but it won't let me add them, only images.

    Thank you for your time,

    All help is appreciated.
  2. Robert
    Robert avatar
    271 posts
    Member since:
    Mar 2011

    Posted 14 May 2012 Link to this post

    Ok ok I spoke a bit too soon. I managed to work it out after stumbling across a little example in the documentation.

    Here's the code:

    private void btnPasteTest_Click(object sender, RoutedEventArgs e)
        var currentPane = radDockingDocumentHost.SelectedPane;
        if (currentPane is RadRichTextBoxAutoComplete)
Back to Top