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

[Solved] GridView DistinctFilter not applied after reset of itemsource!

3 Answers 136 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.
Johannes
Top achievements
Rank 1
Johannes asked on 24 Nov 2010, 11:55 AM
Hi,

I'm filtering two columns, with distinct filters. everything works as expected, as long as I do not update the ItemSource.
When I do reset the ItemSource (does not matter, if I reset to a completely different object, or clear/add the existing ObservableCollection), the Filter isn't applied.

How can I force to reevalute the filters? (or any other way to fix this issue)

Thanks
Johannes

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 24 Nov 2010, 11:59 AM
Hi Johannes,

 When you reset items source everything goes away . You may not even have the same columns with the new source. 

Greetings,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Johannes
Top achievements
Rank 1
answered on 24 Nov 2010, 12:08 PM

Thank you.
Got it working.

after reseting the itemsource, I create a new ColumnFilterDescription, and add all DistinctValues from the old ones:

 

 

ColumnFilterDescriptor tmp = _radGridLagerbestandArtikelFilter;

 

_radGridLagerbestandArtikelFilter =

new ColumnFilterDescriptor((IDataFieldDescriptor)this.radGridLagerbestand.Columns["ARTIKEL"]);

 

 

foreach (var dv in tmp.DistinctFilter.DistinctValues)

 

{

_radGridLagerbestandArtikelFilter.DistinctFilter.DistinctValues.Add(dv);

}

 

this.radGridLagerbestand.FilterDescriptors.Add(_radGridLagerbestandArtikelFilter);

 


....
0
smith
Top achievements
Rank 1
answered on 26 Nov 2010, 10:40 AM
HI 

 i am reset the itemsource want to work last setted filter ? currently it is not working. 


can u  send me some sample code

regards
murugan
Tags
GridView
Asked by
Johannes
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Johannes
Top achievements
Rank 1
smith
Top achievements
Rank 1
Share this question
or