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

Command* parameters

3 Answers 37 Views
This is a migrated thread and some comments may be shown as answers.
bkagan98
Top achievements
Rank 1
bkagan98 asked on 08 Jun 2011, 04:20 AM

There are 4 Command* parameters in RadTreeViewItem: Command, CommandParameter, CommandTarget, and CommandExecutionTrigger. I wasn't able to find any documentation or samples on how they work or used. Would anyone please help me with this? Thanks.

<telerik:RadTreeViewItem Header="Header"
    Command=""
    CommandParameter=""
    CommandExecutionTrigger=""
    CommandTarget=""
/>

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 13 Jun 2011, 12:38 PM
Hi Boris,

I prepared a sample for you that shows a sample command that is bound to RadTreeViewItem`s Command property and it is invoked when the Item is clicked. The command I created is a custom command that implements the ICommand interface - CanExecute and Executed methods. The CommandExecutionTrigger is Enumeration with two elements: Click and DoubleClick and determines whether Command is invoked on mouse Click or mouse DoubleClick. The command parameter is object that can be passed in the Execute and CanExecute methods. The CommandTarget determines the object that the commnad is being executed on. For example you can use ApplicationCommands like Save Cut Copy and set particular TextBox in the CommandTarget.
All of the four properties could be bound cia ContainerBindings in the example provided. Let us know if you need further assistance on this.

Regards,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Frank -
Top achievements
Rank 1
answered on 14 Jun 2011, 10:08 AM
Any chance of getting this example in a VB.NET version?
An example of how to execute a command when a checkbox in a tree is checked/unchecked would have been nice. Preferably with a conmmandparameter saying which item that have been checked/unchecked..


0
Petar Mladenov
Telerik team
answered on 17 Jun 2011, 12:05 PM
Hello Frank -,

You can use various converters for translating C# to VB like this one for example.
On the other hand, you can use the IsChecked property of the RadTreeViewItem and bind it to a boolean property in your ViewModel via ContainerBindings. Then , in the in the setter of the property in the ViewModel, you can invoke a specific method which is equivalent to using a Command and CommadParameter to show which item has been checked. Please let us know if this is suitable for you or if you need assistance in implementing it.


Greetings,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
bkagan98
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Frank -
Top achievements
Rank 1
Share this question
or