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

SfDataGrid how to update ItemsSource after deleting SelectedItems

Thread ID:





119214 May 22,2015 06:40 PM UTC May 25,2015 06:42 AM UTC Xamarin.Android 2
Tags: General
Michel Uiterwijk
Asked On May 22, 2015 06:40 PM UTC

Hi all,

I have a collection of custom objects that I bind to a SfDataGrid with a Multiple SelectionMode.
In a delete button event I delete those selected objects in the collection and rebind it to the grid.
However the grid doesn't update accordingly. I tried setting ItemsSource to null before but this causes a crash.

=== code to fill the grid

_List = datamodel.GetProducts();
_Grid = new SfDataGrid(this);
_Grid.ItemsSource = list;

==== and in delete event

var selected = _Grid.SelectedItems.Cast<Product>().ToList();
foreach (var product in selected)
_Grid.ItemsSource = _List;


Is there an update method on the grid? Or am I missing something?

Kind regards,

P.S.: I put this thread in General because there is no SfDataGrid option in the Control dropdown.

Michel Uiterwijk
Replied On May 22, 2015 07:20 PM UTC

Hi all,

After some real digging into the issue I found that everything works when the list is an ObservableCollection.
There is the magic as the grid automatically responds to changes in the list.

Hope this helps others as well... ;-)

Cheers, Michel.

Saranya CJ [Syncfusion]
Replied On May 25, 2015 06:42 AM UTC

Hi Michel,

Thank you for your update. Please let us know if you require any other assistance on this.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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