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

Treeview LoadOnDemand event in ViewModel

1 Answer 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Sistema PRI
Top achievements
Rank 1
Sistema PRI asked on 23 Sep 2013, 01:11 PM
Hi,
I want to use LoadOnDemand feature from TreeView in ViewModel.
The problem is that if I trigger an event as Command, I get RadRoutedEventArgs as parameter, but I want only the DataItem, that is my object.
I want to keep my ViewModel without any View object.
How Can I do this ?

Best Regards

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 26 Sep 2013, 09:39 AM
Hi,

It is expected that you will receive RadRoutedEventArgs as command parameter when using the Event-To-Command pattern, because the arguments of the subscribed event are sent as command parameters.

Since this approach is not suitable in your scenario, you can subscribe to the LoadOnDemand event of the RadTreeView control and invoke a method defined in your ViewModel form the code behind file of your user control. By doing so you will be able to pass the needed business item into your ViewModel and implement your custom logic there.

I hope that this clarifies your question.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
TreeView
Asked by
Sistema PRI
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or