Skip to content

#169 Widen the left column and grow Filtering Attributes to fit its value - #171

Open
skfd wants to merge 3 commits into
imranakram:masterfrom
comentality:fix/step-form-left-column-layout
Open

skfd wants to merge 3 commits into
imranakram:masterfrom
comentality:fix/step-form-left-column-layout

Conversation

@skfd

@skfd skfd commented Aug 14, 2026

Copy link
Copy Markdown

Follow-up to #169, covering the left-hand column of the same dialog. Builds on #170.

Important

Stacked on top of the right-column PR — please merge that one first.
The commit here moves tlpRightColumn (introduced by that PR) into a new tlpMain, so it cannot stand alone on master. Because the base branch lives in a fork, this PR has to target master directly and therefore shows the right-column commits as well. Once the right-column PR is merged, the diff here reduces to the single left-column commit.

The left-column change on its own: fix/step-form-right-column-layout...fix/step-form-left-column-layout

Problem

Two separate things, both visible when the window is stretched:

  1. grpGeneral had no Anchor at all, so it defaulted to Top, Left and stayed frozen at 451x229 no matter how far the window was dragged — horizontally or vertically. Every field inside it already had Left, Right anchors and was ready to widen; it just never got the chance. At 1400px wide there is roughly 500px of unused width sitting next to a clipped Name field.

  2. Filtering Attributes clipped its value with no way to read it. txtAttributes is Multiline but was configured WordWrap = false, ReadOnly = true, and ScrollBars = None (set in StepRegistrationForm.cs). A 20-attribute list rendered as accountnumber, accountratingcode, address1_city, addr... and could not be scrolled, wrapped, or selected past the edge. The only way to see the whole value was to open the ... dialog.

Fix

Both columns now widen. A new tlpMain splits the form 51.1% / 48.9%. The left column's controls are hosted in a new pnlLeftColumn, and grpGeneral is anchored Top, Left, Right. Anchoring grpGeneral to the right on its own would not work — its right edge would follow the frame while the right column's left edge stayed put, and the two would overlap — so the width has to actually be split.

Filtering Attributes grows to fit its value. It now word-wraps and expands into the spare vertical space of the left column, bounded by what the value actually needs. The rows below it and the group boxes under grpGeneral shift down by the same amount. When there is no spare room it falls back to a vertical scrollbar.

A new ContentHeight property on CrmAttributeSelectionControl measures the height the value needs at the current width. The ... button lost its Bottom anchor so it no longer stretches to the full height of the grown field.

Before / after

Both captured at a client size of 1400x900, with a 20-attribute filtering list.

Before (right-column branch) After

Tall and narrow, 907x1100 — the field wraps to more lines because the column is narrower:

Measured behaviour

Client size grpGeneral Filter field Height needed Scrollbar
907x445 (default) 451x229 @ x12 316x20 95 Vertical
907x700 451x304 316x95 95 None
907x1100 451x304 316x95 95 None
1400x900 703x265 568x56 56 None
1400x1100 703x265 568x56 56 None

Two things worth reading off that table:

  • At the default size the geometry is identical to before this PR — grpGeneral is 451x229 at x=12 and the right column is 439 wide at x=466.
  • Growth stops at what the value needs, not at the window edge: 1100px tall gives the same result as 700px, and a wider window needs fewer lines so the field grows less.

Testing

  • Manual testing on the running tool: resizing the window, and across different DPI settings and display scaling factors.
  • The screenshots and the table above were produced from the real StepRegistrationForm.Designer.cs and CrmAttributeSelectionControl.Designer.cs of each branch, resized at runtime.
  • Solution builds clean.

Notes

  • The disabled state (DisabledMessage shown when the message/entity does not support filtered attributes) forces growth to 0, so the field stays at its original height. That path was not rendered during testing.
  • UpdatePluginEventHandlerControls copies cmbPlugins.Location/.Size onto cmbWebhook and cmbServiceEndpoint. All three move together with the rest of the rows, so the three stacked combos stay in sync.

skfd added 3 commits August 13, 2026 19:45
…esized

The Description, Unsecure Configuration and Secure Configuration group boxes
each used a different anchor set: Description anchored Top, Secure Configuration
anchored Bottom, and Unsecure Configuration anchored neither, so it drifted to
the vertical centre. Growing the Update Existing Step window therefore spread
the three boxes apart and left large empty bands between them instead of
enlarging the multiline fields.

Host the three group boxes in a single-column TableLayoutPanel anchored to all
four edges, with percentage rows (22/34/44) that reproduce the original
proportions at the designer size and share any extra height between the three
fields.
…nfig fields

The Description field is normally a single line, so growing it with the window
wasted the space the Unsecure/Secure Configuration editors need. Pin its row to
its designer height (89px) and split all remaining height between the two
configuration fields.
…fit its value

grpGeneral had no Anchor at all, so the entire left column stayed 451x229 no
matter how far the window was stretched, and the Filtering Attributes field
clipped long attribute lists with WordWrap off, ScrollBars None and ReadOnly on
- leaving no way to read the value except the selection dialog.

Split the form horizontally with tlpMain (51.1%/48.9%) so both columns widen,
with the left column's controls hosted in pnlLeftColumn and grpGeneral anchored
Top|Left|Right. At the designer size the geometry is unchanged: grpGeneral is
451x229 at x=12 and the right column is 439 wide at x=466, exactly as before.

Filtering Attributes now word-wraps and grows into the spare vertical space of
the left column, bounded by what the value actually needs, with the rows below
it and the group boxes under grpGeneral shifting down by the same amount. When
there is no spare room it falls back to a vertical scrollbar. The "..." button
no longer stretches with the field.
Copilot AI lite review requested due to automatic review settings August 14, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the WinForms “Register New Step / Update Existing Step” dialog layout so both columns resize with the window and the Filtering Attributes field becomes readable for long attribute lists by wrapping and expanding vertically when space allows.

Changes:

  • Restructures the form into a two-column tlpMain and anchors/docks containers so both left and right columns can widen and the right column can grow vertically.
  • Adds runtime layout logic to grow crmFilteringAttributes based on measured content height and available spare height in the left column, shifting controls below accordingly.
  • Updates CrmAttributeSelectionControl to expose a ContentHeight measurement and adjusts the selector button anchoring to avoid stretching.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
Xrm.Sdk.PluginRegistration/Forms/StepRegistrationForm.Designer.cs Introduces tlpMain/pnlLeftColumn/tlpRightColumn and adjusts anchoring/docking to enable responsive two-column layout.
Xrm.Sdk.PluginRegistration/Forms/StepRegistrationForm.cs Implements capture/apply logic to dynamically size the Filtering Attributes control and reposition dependent controls during resize/content changes.
Xrm.Sdk.PluginRegistration/Controls/CrmAttributeSelectionControl.Designer.cs Updates the ... button anchoring so it no longer stretches vertically with the text field growth.
Xrm.Sdk.PluginRegistration/Controls/CrmAttributeSelectionControl.cs Adds ContentHeight for measuring wrapped text height and supports the new resize behavior.
Files not reviewed (2)
  • Xrm.Sdk.PluginRegistration/Controls/CrmAttributeSelectionControl.Designer.cs: Generated file
  • Xrm.Sdk.PluginRegistration/Forms/StepRegistrationForm.Designer.cs: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants