Skip to content

Commit

Permalink
UI-related to the layouts #766
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Aug 18, 2022
1 parent 3670295 commit 1479bea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 9 additions & 4 deletions FetchXmlBuilder/Controls/attributeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ protected override ControlValidationResult ValidateControl(Control control)
return base.ValidateControl(control);
}

protected override void SaveInternal(bool keyPress)
{
base.SaveInternal(keyPress);
if (IsInitialized)
{
UpdateCellFromUI();
}
}

private void chkGroupBy_CheckedChanged(object sender, EventArgs e)
{
EnableAggregateControls();
Expand Down Expand Up @@ -118,10 +127,6 @@ private void helpIcon_Click(object sender, EventArgs e)
private void cmbAttribute_SelectedIndexChanged(object sender, EventArgs e)
{
fxb.ShowMetadata(Metadata());
if (IsInitialized)
{
UpdateCellFromUI();
}
}

internal void UpdateUIFromCell()
Expand Down
7 changes: 7 additions & 0 deletions FetchXmlBuilder/Controls/entityControl.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Xrm.Sdk.Metadata;
using Rappen.XTB.FetchXmlBuilder.ControlsClasses;
using Rappen.XTB.FetchXmlBuilder.DockControls;
using Rappen.XTB.FetchXmlBuilder.Views;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
Expand Down Expand Up @@ -61,6 +62,12 @@ protected override ControlValidationResult ValidateControl(Control control)
private void cmbEntity_SelectedIndexChanged(object sender, System.EventArgs e)
{
fxb.ShowMetadata(Metadata());
if (IsInitialized &&
cmbEntity.SelectedItem is EntityItem item &&
item.Meta?.LogicalName != fxb.dockControlBuilder.LayoutXML?.EntityMeta?.LogicalName)
{
fxb.dockControlBuilder.LayoutXML = new LayoutXML(item.Meta, fxb);
}
}

public override MetadataBase Metadata()
Expand Down

0 comments on commit 1479bea

Please sign in to comment.