Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1675
xamgrid - stackoverflow exception when applying a big condition to the filter
posted

Because of the bug "CAS-121066-B5D6C5" http://es.infragistics.com/community/forums/p/83161/417509.aspx#417509 I cannot use collectionviewsource to filter out the rows i want to show on the grid.

I am not instead programatically setting the filter on the grid with below code, it all works okay, but when I try to set the filter with 1000+ condition, i get a stackoverflow exception, i think the grid is trying to compile an expression and dies because of the overflow thus taking the process down with it

var rowFiltersCollection = rowsManager.RowFiltersCollectionResolved;

var rowsFilter = new RowsFilter(typeof(<DataType>), Grid.Columns.DataColumns[<ColumnName>]);
rowsFilter.Conditions.LogicalOperator = LogicalOperator.Or;
rowsFilter.Conditions.Clear();

if (listOfFilterInToApply.Any())
{
foreach (var id in listOfFilterInToApply)
{
rowsFilter.Conditions.Add(new ComparisonCondition
{
CaseSensitive = false,
FilterValue = id,
Operator = ComparisonOperator.Equals
});
}
}

rowFiltersCollection.Add(rowsFilter);