Hello,
I am having some problems on our solution with the IColumnFilterDescriptor.
Here is our C# implementation :
The problem occurs when we in the gridview, we have 2 different item types at the same level. Here is the error we are getting on the columnDescriptor.ResumeNotifications() event :
ArgumentException :
The value "(Empty) AND ((Title Contains ma) AND (Title IsNotNull null))" is not of type "Telerik.Windows.Data.IFilterDescriptor" and cannot be used in this generic collection.
Parameter name: value
We are following the examples shown on your site.
We've been trying to figure out this problem for ours without any success. Any idea where this problem comes from?
I am having some problems on our solution with the IColumnFilterDescriptor.
Here is our C# implementation :
private
void
searchTextbox_KeyDown(
object
sender, KeyEventArgs e)
{
if
(e.Key == Key.Enter)
// Enter key pressed
{
this
.treeListView.FilterDescriptors.Clear();
var searchTextBox = (TextBox)sender;
if
(!
string
.IsNullOrWhiteSpace(searchTextBox.Text))
{
//this.treeListView.FilterDescriptors.SuspendNotifications();
if
(
this
.FilterColumns.Count() < 2)
{
var filterColumn =
this
.treeListView.Columns[0];
filterColumn.ClearFilters();
IColumnFilterDescriptor columnDescriptor = filterColumn.ColumnFilterDescriptor;
columnDescriptor.FieldFilter.Clear();
if
(!
string
.IsNullOrWhiteSpace(searchTextBox.Text))
{
columnDescriptor.SuspendNotifications();
columnDescriptor.FieldFilter.Filter1.Operator = FilterOperator.Contains;
columnDescriptor.FieldFilter.Filter1.Value = searchTextBox.Text.Trim();
columnDescriptor.FieldFilter.Filter1.IsCaseSensitive =
false
;
if
(columnDescriptor.FieldFilter.Filter2 !=
null
)
{
columnDescriptor.FieldFilter.Filter2.Operator = FilterOperator.IsNotNull;
columnDescriptor.FieldFilter.Filter2.Value =
null
;
}
try
{
columnDescriptor.ResumeNotifications();
}
catch
(ArgumentException) { }
}
}
else
{
CompositeFilterDescriptor compositeDescriptor =
new
CompositeFilterDescriptor();
compositeDescriptor.LogicalOperator = FilterCompositionLogicalOperator.Or;
foreach
(var column
in
this
.FilterColumns)
{
compositeDescriptor.FilterDescriptors.Add(
new
FilterDescriptor(column,FilterOperator.Contains, searchTextbox.Text,
false
,
typeof
(
string
)));
}
//this.treeListView.FilterDescriptors.SuspendNotifications();
this
.treeListView.FilterDescriptors.Add(compositeDescriptor);
//this.treeListView.FilterDescriptors.ResumeNotifications();
}
//this.treeListView.FilterDescriptors.ResumeNotifications();
}
}
}
The problem occurs when we in the gridview, we have 2 different item types at the same level. Here is the error we are getting on the columnDescriptor.ResumeNotifications() event :
ArgumentException :
The value "(Empty) AND ((Title Contains ma) AND (Title IsNotNull null))" is not of type "Telerik.Windows.Data.IFilterDescriptor" and cannot be used in this generic collection.
Parameter name: value
We are following the examples shown on your site.
We've been trying to figure out this problem for ours without any success. Any idea where this problem comes from?