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
360
Filter hierarchic Rows in a xamlgrid
posted

I have a textbox which is responsible for filtering the xamdatagrid has an attachedproperty to filter the grid.

Here is the code for the TextChanged:

 private static void OnFilterTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
                var dp = d as DataPresenterBase;
 
                if (dp.DefaultFieldLayout != null)
                {
                    dp.DefaultFieldLayout.RecordFilters.Clear();
                    dp.DefaultFieldLayout.Settings.RecordFiltersLogicalOperator = LogicalOperator.Or;

                    foreach (var field in dp.DefaultFieldLayout.Fields)
                    {
                        var filter = new RecordFilter();
                        filter.Field = field;
                        filter.Conditions.Add(new ComparisonCondition(ComparisonOperator.Contains, e.NewValue));
                        dp.DefaultFieldLayout.RecordFilters.Add(filter);
                    }
                }
}

What do I have to do that the filtering is also applied to the all rows (bands)?

I tried already RecordFilterScope="AllRecords"  but this wasn't the trick.

sincerely