Skip to content

Commit

Permalink
Fixing #773 Removing value and also valueof when needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Feb 6, 2023
1 parent 98a3e47 commit 308bcfd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion FetchXmlBuilder/Controls/conditionControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,26 @@ protected override ControlValidationResult ValidateControl(Control control)
protected override Dictionary<string, string> GetAttributesCollection()
{
var result = base.GetAttributesCollection();
if (!result.ContainsKey("value") && cmbValue.Enabled && cmbValue.DropDownStyle == ComboBoxStyle.Simple)
if (panValueOf.Visible == false && result.ContainsKey("valueof"))
{
result.Remove("valueof");
}
if (panValueOf.Visible == true && result.ContainsKey("valueof") && !string.IsNullOrWhiteSpace(result["valueof"]))
{
if (result.ContainsKey("value"))
{
result.Remove("value");
}
}
else if (!result.ContainsKey("value") && cmbValue.Enabled && cmbValue.DropDownStyle == ComboBoxStyle.Simple)
{
result.Add("value", "");
}
if (cmbOperator.SelectedItem is OperatorItem oper && oper.IsMultipleValuesType)
{
result.Remove("value");
result.Remove("valueof");
}
return result;
}

Expand Down

0 comments on commit 308bcfd

Please sign in to comment.