RibbonView command

2 posts, 0 answers
  1. Wang
    Wang avatar
    46 posts
    Member since:
    Oct 2011

    Posted 06 Nov 2016 Link to this post


    I have a problem when using diagram in ribbonview,

    I want to set the 'New','Open','Save' button of the firstlook demo to the RadRibbonBackstage, the code is:

                    <TextBlock Text="Begin" Margin="10 2" />

                        <telerik:RadRibbonBackstageItem Header="New" IsSelectable="False" Icon="pack://application:,,,/FOSS.Common;component/Images/new32.png" Command="telerik:DiagramCommands.Clear"
    CommandTarget="{Binding ElementName=diagram}"/>
                        <telerik:RadRibbonBackstageItem Header="Open" IsSelectable="False" Icon="pack://application:,,,/FOSS.Common;component/Images/open32.png" Command="telerik:DiagramCommands.Open" 
    CommandTarget="{Binding ElementName=root}"/>
                        <telerik:RadRibbonBackstageItem Header="Save" IsSelectable="False" Icon="pack://application:,,,/FOSS.Common;component/Images/save32.png" Command="telerik:DiagramCommands.Save"
    CommandTarget="{Binding ElementName=root}" />

    There are two problem:

    1.the open and save command did not work.

    2.when the window loaded,if I click the "Begin" button, the RadRibbonBackstageItems is not enabled,but when I click the digram,and click the "Begin" button, the RadRibbonBackstageItems is enabled.

    what should I do?

  2. Tanya
    Tanya avatar
    583 posts

    Posted 09 Nov 2016 Link to this post

    Hello Wang,

    You should register the command bindings of RadDiagram as demonstrated in the examples from the Serialization article.

    In order to enable the buttons in RibbonView, the diagram should be focused. You can call the Focus() method of RadDiagram in the constructor of the window. This will ensure that the control is focused and the buttons are enabled.

    Hope this helps.

    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top