ListCollectionView

Is it possible to bind a Filtered ListCollectionView into the GridDataControl ItemsSource? If i bind this collection, only the unfiltered collection shows up on the grid even though the Grid's DataContext says that ItemsLcv has the correct filtered count.

It's as if the GridDataControl is binding to ListCollectionView.SourceCollection rather than the ListCollectionView with the filter.

I don't know what i'm doing wrong so please help.


I bind it like so..

grid.SetBinding(GridDataControl.ItemsSourceProperty, new Binding("ItemsLcv"));

And my ListCollectionView is created like..

public ListCollectionView ItemsLcv
{
get { return _itemsLcv; }
set
{
_itemsLcv = value;
BuildItemView();
}
}



SelectionExpanderDefinition(ObservableCollection dataItems, List filters ){
_selectionFilters = filters;
_itemsLcv = new ListCollectionView(new List(dataItems));
BuildItemView();
}

public void BuildItemView()
{
// set up LCV
System.Predicate<object> expanderContentFilter = blah blah filter method

_itemsLcv.Filter = expanderContentFilter;
}






1 Reply

RA Rajasekar Syncfusion Team January 25, 2012 07:46 AM UTC

HI Rich,

Thanks for your update, We have prepared the sample based on your requirement and please find the sample in the below location,

Sample: http://www.syncfusion.com/downloads/Support/DirectTrac/88696/SFGridFilter-743336333.zip

Please let us know if you have any queries.

Thanks,
Rajasekar



Loader.
Up arrow icon