FormatRuleExpressionEditorForm 使用

 /// <summary>
        /// 高级查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            GridFormatRule condition = new GridFormatRule();
            condition.Rule = new FormatConditionRuleExpression();
            currentView.FormatRules.Add(condition);
            FormatConditionRuleExpression rule = condition.Rule as FormatConditionRuleExpression;
            if (rule == null) return;
            using (ExpressionEditorForm form = new FormatRuleExpressionEditorForm(rule, null, rule.Expression))
            {
                form.StartPosition = FormStartPosition.CenterParent;
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    rule.Expression = form.Expression;//查询表达式
                }
            }
        }

 

posted @ 2017-06-06 23:18  一路来过  阅读(894)  评论(0编辑  收藏  举报