Hi guys,
is there a possibility to add more than 2 FieldFilters to a column?
I built up a DependencyProperty named Filters, when i add a filter in my viewmodel, the filter will be set to the column:
is there a possibility to add more than the two filters?
The problem is, that the filtering via viewmodel and rebind data is to slow. we noticed that the filtering via column is pretty much faster.
Now we got keys in a column like AEOKS... and we have to check wether the column is containing a key ("A")
Best wishes to you
David
is there a possibility to add more than 2 FieldFilters to a column?
I built up a DependencyProperty named Filters, when i add a filter in my viewmodel, the filter will be set to the column:
if
(e.NewValue !=
null
&& e.NewValue.GetType() ==
typeof
(FilterDescriptorCollection))
{
if
(((FilterDescriptorCollection)e.NewValue).Count != 0)
{
GridViewColumn gridColumn =
this
.Columns[((FilterDescriptor)((FilterDescriptorCollection)e.NewValue)[0]).Member];
IColumnFilterDescriptor columnFilter = gridColumn.ColumnFilterDescriptor;
columnFilter.FieldFilter.Clear();
columnFilter.SuspendNotifications();
foreach
(FilterDescriptor filter
in
((FilterDescriptorCollection)e.NewValue))
{
if
(columnFilter.FieldFilter.Filter1.Value.ToString() != filter.Value.ToString() && columnFilter.FieldFilter.Filter2.Value.ToString() != filter.ToString())
{
if
(columnFilter.FieldFilter.Filter1.Value.ToString() ==
""
)
{
columnFilter.FieldFilter.Filter1.Operator = FilterOperator.Contains;
columnFilter.FieldFilter.Filter1.Value = filter.Value;
}
else
{
columnFilter.FieldFilter.Filter2.Operator = FilterOperator.Contains;
columnFilter.FieldFilter.Filter2.Value = filter.Value;
}
}
}
columnFilter.ResumeNotifications();
}
}
is there a possibility to add more than the two filters?
The problem is, that the filtering via viewmodel and rebind data is to slow. we noticed that the filtering via column is pretty much faster.
Now we got keys in a column like AEOKS... and we have to check wether the column is containing a key ("A")
Best wishes to you
David