Janus GridEx:如何过滤整数和字符串

时间:2014-02-20 00:12:32

标签: c# gridex

我正在向Janus GridEx添加一个关键字搜索,并认为最简单的方法就是将每个列的OR一起过滤条件。大多数列都是字符串,它们工作正常。如果“From”是整数列,则最后一行在执行条件时失败,并显示错误“输入字符串格式不正确”。我可以添加过滤条件和一些String类型的列,有些列类型为Integer吗?

        var fromCondition = new GridEXFilterCondition();
        fromCondition.Column = dgDrawings.RootTable.Columns["From"];
        fromCondition.ConditionOperator = ConditionOperator.Contains;
        fromCondition.Value1 = keyword_searchTextBox.Text;

        var toCondition = new GridEXFilterCondition();
        toCondition.Column = dgDrawings.RootTable.Columns["To"];
        toCondition.ConditionOperator = ConditionOperator.Contains;
        toCondition.Value1 = keyword_searchTextBox.Text;

        compositeCondition.AddCondition(LogicalOperator.Or, fromCondition);
        compositeCondition.AddCondition(LogicalOperator.Or, toCondition);

        drawings.RootTable.FilterCondition = compositeCondition;

`

0 个答案:

没有答案