Hi!
I am trying to implement custom filtering in my application, during my Implementation a few things are not clear to me, so i hope somebody explain me these thing.
I tred to add several Custom Filtering Options like this
but none of these options are displayed in my list, only one option is displayed with the name custom.
How can i add more then one custom filtering option in the menu?
Then i tried to get it running with this sinlge option, but in the itemCommand Fired Event i got a Parse Exception, i checked my filter expression but i cannot find any error.
Here is the code of the EventHandler
The exception occurs when Rebind is called, what problem can cause this exception?
Is it possible that the FilterPair.first value is the name of the CustomFilter?
Regards,
Martin
I am trying to implement custom filtering in my application, during my Implementation a few things are not clear to me, so i hope somebody explain me these thing.
I tred to add several Custom Filtering Options like this
GridFilterMenu filterMenu = MaintenanceGrid.FilterMenu; |
RadMenuItem menuItem = new RadMenuItem("Valid", "Contains"); |
filterMenu.Items.Add(menuItem); |
but none of these options are displayed in my list, only one option is displayed with the name custom.
How can i add more then one custom filtering option in the menu?
Then i tried to get it running with this sinlge option, but in the itemCommand Fired Event i got a Parse Exception, i checked my filter expression but i cannot find any error.
Here is the code of the EventHandler
if (filterPair.First.ToString().Equals("Custom")) |
{ |
string columName = filterPair.Second.ToString(); |
TextBox tbPattern = (e.Item as GridFilteringItem)[columName].Controls[0] as TextBox; |
string[] values = tbPattern.Text.Split(' '); |
// string newFilter = "(([" + filterPair.Second + "] ='" + values[0] + "') AND ([" + filterPair.Second + "] ='" + values[1] + "'))"; |
string newFilter = "(([" + filterPair.Second + "] ='" + values[0] + "'))"; |
if (MaintenanceGrid.MasterTableView.FilterExpression == "") |
{ |
MaintenanceGrid.MasterTableView.FilterExpression = newFilter; |
} |
else |
{ |
MaintenanceGrid.MasterTableView.FilterExpression = "((" + |
MaintenanceGrid.MasterTableView.FilterExpression + ") AND (" + newFilter + "))"; |
} |
MaintenanceGrid.Rebind(); |
} |
The exception occurs when Rebind is called, what problem can cause this exception?
Is it possible that the FilterPair.first value is the name of the CustomFilter?
Regards,
Martin