我正在向 Janus GridEx 添加关键字搜索,并认为最简单的方法是将每列的一些过滤条件组合在一起。大多数列都是字符串,它们工作正常。如果“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;
`