We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to fire the events in SfDataGrid by using the commands defined in the ViewModel?

Platform: Xamarin.Forms |
Control: SfDataGrid |
Published Date: May 27, 2016 |
Last Revised Date: December 15, 2016
Tags: event, commands

Events in SfDataGrid can be fired by using commands with the help of Xamarin.Forms.Behaviors. The Xamarin.Forms.Behaviors allows you to convert events into commands. To use it, you need to install the Xamarin.Forms.Behaviours NuGet in your application which can be find in the below link.

NuGet Link: https://www.nuget.org/packages/Xamarin.Forms.Behaviors/

Refer the below code example in which Xamarin.Forms.Behaviors has been used to convert the SelectionChanged event in SfDataGrid into command.

XAML

 

ViewModel.cs

 

Screenshot

C:\Users\indhumathy.malayappa\Desktop\Capture.PNG


You can download a working sample for this KB here.

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon