Command* parameters

4 posts, 0 answers
  1. bkagan98
    bkagan98 avatar
    16 posts
    Member since:
    Feb 2011

    Posted 07 Jun 2011 Link to this post

    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=""
    />
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 13 Jun 2011 Link to this post

    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
  3. DevCraft banner
  4. Frank -
    Frank - avatar
    8 posts
    Member since:
    Apr 2010

    Posted 14 Jun 2011 Link to this post

    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..


  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Jun 2011 Link to this post

    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
Back to Top