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

[Solved] LINQ query as ItemSource updating issue

1 Answer 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Doug
Top achievements
Rank 1
Doug asked on 06 Oct 2010, 12:24 PM
I am using the following statement to bind my data to the grid:


MyDataGrid.ItemsSource = completeProductList.Where(p => p.Visible);


completeProductList is simply a List<Product> collection and Product has various properties including a boolean Visible property.

The grid displays the correct items when loaded but if some of the products change their visible property in the background (not via the grid) they are not removed from the grid until I do a column sort or other action.

Is there a way to get the grid to automatically spot the change to the results of the LINQ expression and update the grid immediately or do I need to handle some event etc.

Thanks in advance,
Doug

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 06 Oct 2010, 12:29 PM
Hello Doug,

 If the grid ItemsSource is not INotifyCollectionChanged the grid will now know if you change the collection. 

Sincerely yours,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Doug
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or