Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

C#
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
Posted
Updated 23-Mar-20 16:30pm
v2

1 solution

Why are you posting this here?? Why not some place far more appropriate, like the developer forums at Janus' site?? The link to click on is in the bottom left corner of their home page.
 
Share this answer
 
Comments
Reza Ahmadi 2-May-12 0:56am    
Could you please post the link, I did not find it
Dave Kreskowiak 2-May-12 7:53am    
Are you kidding me?? You couldn't type "Janus controls" into Google??

http://www.janusys.com/controls/
Reza Ahmadi 2-May-12 8:35am    
No actually! we programmers sometimes(!) are lazy! I reported the bug to it's programmers. Thanks any way

Cheers
Reza Ahmadi 2-May-12 8:37am    
My 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900