Hello guys,
I'm using Janus 3.0 controls(it is a fairly old version but the company insists to use that version) in a win-based application to create UI in the application. I see a bug in the
FilterEditor control and here is the whole story ( I presume you know how it works basically):
I have a FilterEditor control to create a filter which is bound to the grid. It works fine and it filters the grid according to selected field and entered value in it. However, when I select an operator ,namely, Contains, which is a valid operator for String type, it(Contains) will appear for the Int, DateTime, or every other DataType which will be selected!
Here is some code to clearify, this code will run when a another field is selected to filter based on that, I mean when we select FirstName and then we change it to LastName and etc.
private void filterEditor1_FilterConditionChanged(object sender, EventArgs e)
{
var dataType = filterEditor1.FilterCondition.Field.DataTypeCode.ToString();
if (dataType == typeof(string).Name)
{
filterEditor1.AvailableConditionOperators =
Windows.FilterEditor.AvailableConditionOperators.Contains
| Windows.FilterEditor.AvailableConditionOperators.NotContains
| Windows.FilterEditor.AvailableConditionOperators.BeginsWith
| Windows.FilterEditor.AvailableConditionOperators.EndsWith;
}
if (dataType == typeof(int).Name)
{
filterEditor1.AvailableConditionOperators =
Windows.FilterEditor.AvailableConditionOperators.GreaterThan
| Windows.FilterEditor.AvailableConditionOperators.LessThan;
}
if (dataType == typeof(DateTime).Name)
{
filterEditor1.AvailableConditionOperators =
Windows.FilterEditor.AvailableConditionOperators.Between;
}
filterEditor1.Update();
Janus.Data.IJanusTable IJanusTable = filterEditor1.Table;
}
Thanks for your help,
Reza