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.
Unfortunately, activation email could not send to your email. Please try again.

How to add and delete rows and columns in runtime?

SfDataGrid allows you to add or delete rows and columns from the ItemsSource in run time. When you set the ItemsSource of the grid with a collection that implements the ICollectionChanged interface then the SfDataGrid automatically refreshes the view against the CRUD operations.

Refer the below code example in which the SfDataGrid is set with an ObservableCollection as ItemsSource. The ObservableCollection implements the INotifyCollectionChanged interface and hence will result in automatic refreshing of view when adding or removing rows or columns in runtime.

Refer the following code example to add or remove rows and columns in SfDataGrid at runtime.

 

When the ItemsSource of the grid is set with a collection that does not implement the interface ICollectionChanged interface, then the grid has to be manually refreshed for runtime changes.

The following screenshot shows the final outcome upon execution of the above code

Refer Sample:
http://www.syncfusion.com/downloads/support/directtrac/general/ze/CRUD-638827037

 

 

 

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

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.