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

Accessing the CommandParameter

2 Answers 77 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Henri
Top achievements
Rank 1
Henri asked on 29 Mar 2012, 02:15 PM
Hi,

I'm trying to implement a copy function.

In XAML I did the following:
<telerik:RadButton Command="telerik:RadDataFormCommands.AddNew" CommandTarget="{Binding ElementName=df}"
        ToolTip="Copy" CommandParameter="copy">
<telerik:RadButton.Content>
   <Image Source="Images/Copy.png"/>
</telerik:RadButton.Content>
</telerik:RadButton>


How can I get access to the CommandParameter "copy" in the code-behind so that I can determine that a copy is needed instead of a regular AddNew?

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 29 Mar 2012, 02:26 PM
Hi,

CommandParameter is a DependencyProperty. You can bind it to a property of your ViewModel.

All the best,
Ivan Ivanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Bernard Grosperrin
Top achievements
Rank 1
answered on 19 Apr 2012, 11:01 PM
Would it be possible to get an example for this ?
Tags
DataForm
Asked by
Henri
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Bernard Grosperrin
Top achievements
Rank 1
Share this question
or