private void RefreshOperators() { if (!IsInitialized) { return; } if (cmbAttribute.SelectedItem is AttributeItem attributeItem && attributeItem.Metadata.AttributeType is AttributeTypeCode attributeType) { //cmbOperator.SelectedItem = null; cmbOperator.Items.Clear(); cmbOperator.Items.AddRange(OperatorItem.GetConditionsByAttributeType(attributeType)); ReFillControl(cmbOperator); } }
private void cmbAttribute_SelectedIndexChanged(object sender, EventArgs e) { if (cmbAttribute.SelectedItem != null) { var attributeType = ((AttributeItem)cmbAttribute.SelectedItem).Metadata.AttributeType; if (attributeType.HasValue) { var tmpColl = ControlUtils.GetAttributesCollection(this.Controls, false); cmbOperator.SelectedItem = null; cmbOperator.Items.Clear(); cmbOperator.Items.AddRange(OperatorItem.GetConditionsByAttributeType(attributeType.Value)); ControlUtils.FillControl(tmpColl, cmbOperator); } } UpdateValueField(); }