当打开一些默认参数的过滤器控件出现给用户时,我需要知道如何向过滤器控件添加模式我尝试如下
[C#]Open in popup window
private void Padroes(ControleCaixaFiltro _controleCaixaFiltro, PropertyInfo prop)
{
CustomClauseNode clausula = new CustomClauseNode(_controleCaixaFiltro.Model);
FilterControlHelpers.ForceAdditionalParamsCount(clausula.AdditionalOperands, 1);
clausula.Operation = ClauseType.Equals;
clausula.FirstOperand = new OperandProperty(prop.Name);
clausula.ChangeElement(ElementType.Operation);
_controleCaixaFiltro.NoPrincipal.SubNodes.Add(clausula);
}
问题是节点以这种方式出现,但您无法通过单击“x”侧来删除它们
devexpress的版本是2012
此代码不起作用
protected override ClauseNode CreateDefaultClauseNode(FilterColumn column)
{
ClauseNode defaultNode = base.CreateDefaultClauseNode(column);
if (defaultNode.AdditionalOperands.Count > 0)
{
OperandValue rightOperand = defaultNode.AdditionalOperands[0] as OperandValue;
if (rightOperand != null)
{
rightOperand.Value = DateTime.Now;
}
}
return defaultNode;
}