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

RibbonView command

1 Answer 69 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Wang asked on 07 Nov 2016, 04:55 AM


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?

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 09 Nov 2016, 04:44 PM
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!
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question