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

Question about multibinding in EventToCommandBehavior.EventBindings

1 Answer 625 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Psyduck asked on 24 Mar 2021, 05:04 AM

Hello.

<EventToCommandBehavior.EventBindings> is very similar to the <interaction.triggers> function.

I want to ask if multibinding is possible here.

Is there a way to get both CommandParameter and eventArgs?

 

I can't build this source, but I hope this will happen. like this

<View.xaml>
<telerik:EventToCommandBehavior.EventBindings>
    <telerik:EventBinding EventName="CellPropertyChanged"
          Command="{Binding Command}"
          PassEventArgsToCommand="True"
          CommandParameter={binding ElementName="gridview"/>
</telerik:EventToCommandBehavior.EventBindings>
 
<ViewModel.cs>
private void Command(object[] obj)
{
    var sender = obj[0] as RadGridView;
    var e = obj[1] as CellPropertyChangedEventArgs;
}

 

 

 

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 25 Mar 2021, 02:05 PM

Hello KIM,

You can use MultiBinding with the CommandParameter, but this won't help for your specific requirement. Using the MultiBinding won't allow you to pass the event arguments because there is no source that contains them. They are created and used with the EventBinding after the event is fired. To achieve your requirement, you can use code-behind as shown in my last reply in the other forum on this topic.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Martin Ivanov
Telerik team
Share this question
or