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?

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.

Article ID: Published Date: Last Revised Date: Platform: Control:
6905 05/27/2016 12/15/2016 Xamarin.Forms SfDataGrid
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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