This project has moved. For the latest updates, please go here.
1

Resolved

Loss of filter text when loading data

description

If a datagrid has a filter applied and the datagrid is bound to an observablecolllection, when the observablecollection is recreated. e.g. when loading data from a database.

The filter text is not shown in the header and no results are displayed.

The only way I have found to get the content to be displayed is to type something in the filter textbox and then delete it, this shows all of the data.

comments

tomenglert wrote Mar 29, 2014 at 5:20 PM

I'm not sure if I understand this correctly.
Do you mean the content of the ObservableCollection is reset, or the collection is exchanged with an new one?

Can you provide some sample code?

ncik_w wrote Apr 8, 2014 at 12:35 PM

Sorry for describing very well, here is a code sample of what I mean by recreated:

private ObservableCollection<Foo> _foos;
public ObservableCollection<Foo> Foos
{
get { return _foos; }
set
{
_foos = value;
OnPropertyChanged("Foos");
}
}

public void LoadData()
{
IList<Foo> foos = _database.GetFoos();
Foos = new ObservableCollection(foos);
}

Calling load data while a filter is enabled removes the filter text, but not filter itself.

wrote Apr 9, 2014 at 2:16 PM

Associated with changeset 30702.

wrote Apr 9, 2014 at 5:49 PM

tomenglert wrote Apr 9, 2014 at 5:53 PM

P.S. This only happens if "AutoGenerateColumns" is on. In this case it's not possible to preserve the filter, since all columns are destroyed and recreated if ItemsSource changes.

coach008 wrote Nov 6, 2015 at 12:35 AM

sin1106
http://www.usalouisvuittonoutlet-stores.com
http://www.uggs-forwomen.net
http://www.louisvuittonoutlet--2014.com
http://www.nikerosherunflyknit.com
http://www.stefanjanoskimax.net
http://www.coachfactoryoutletonline2015.com
http://www.moncler-forsale.net
http://www.moncler-on-sale.org
http://www.saleuggbootsoutletstore.net
http://www.michaelkorspurses2015.net
http://www.rosherunmen.org
http://www.michaelkorsoutletonlinee.net
http://www.coachfactory2015.com
http://www.mensmonclerjacketsoutlet.net
http://www.katespadehandbags-outlet.net
http://www.kobe10sneaker.com
http://www.katespadefactory.org
http://www.2015michaelkorsoutlet.org
http://www.cheapnikeairmaxltd.com
http://www.michaelkorsoutletonline.win
http://www.coach-outletcoupons.com
http://www.nikeairmax90classic.com
http://www.coachfactoryusa.net
http://www.nikeairhuarache.net
http://www.nikeairmaxtheapremium.com
http://www.mkpurses2015.com
http://www.katespade2015.org
http://www.nike-airmaxthea.org
http://www.michaelkorsoutletsonline.cc
http://www.saleuggsoutletstore.org
http://www.michaelkorsoutletstore.date
http://www.michaelkorsoutlet.review
http://www.louisvuitton-bags-2015.com
http://www.nikeairmax90shoes.com
http://www.mkmichaelkorsbags.net
http://www.airmax90-ice.org
http://www.2015coachfactoryoutlet.com
http://www.cheaplouisvuitton-bagso.net
http://www.katespadepursesus.org
http://www.coachbagsoutletfactory.net
http://www.coachoutlet2015.net
http://www.louisvuittonclutchs.com
http://www.coachoutlet-factorystore.org