Column width of GridBagLayout sometimes changes when changing the X Fill constraint of a managed control with an X Weight constraint of 1.

I'm using version 19.4.0.52 of the Syncfusion Windows Forms controls in Visual Studio 2022 with a .Net Framework 4.8 project.

I'm using a GridBagLayout to manage the layout of some controls in a panel.

Here's a screenshot of the controls before I set any Fill constraints on any of the TextBox controls.

Setting the Fill constraint on the first two TextBoxes didn't change the column width, but once I set it on the third TextBox, the column width was changed as seen in this screenshot.

I tried working around the issue by setting the horizontal Weight constraints of the TextBoxes to 0 and then back to 1, but it didn't change the size of the first three TextBoxes.

My expectation was that changing the horizontal Fill constraint of the TextBox would change the size of the TextBox within its column in the layout, but would leave the size of the column alone.


6 Replies

SN Sudharsan Narayanan Syncfusion Team March 2, 2022 03:33 AM UTC

Hi David,

We were unable to reproduce the reported issue that “Column Width is changed” from our end. If we set the width
constraints for the Textbox, the fill constraints will be remained size in the below sample. So, Please see the sample provided below.

Sample: https://www.syncfusion.com/downloads/support/forum/173075/ze/GridBagLayoutSample-2015427948

Please check the sample and let us know your concerns. If we are misunderstood your query, Please modify the sample, and share the details about the replication steps of reported query and video for the same. So, it would be helpful for us to proceed further and provide a prompt solution to this.

Regards,
Sudharsan



DF David Frischknecht replied to Sudharsan Narayanan March 2, 2022 09:16 AM UTC

I had to modify your sample since the issue only occurs when there are multiple columns in the GridBagLayout.

I've zipped up and attached the sample.  When you open it, you'll see it in the same state as the first screenshot below.  The second screenshot I took after I selected all the TextBox controls and set their Fill constraints to Horizontal.  As I stated previously, my expectation is that the columns will stay the same size and the TextBox controls will expand in width to fill the columns they're in.

The TextBox controls have their WeightX constraints set to 1.  All the other controls have their WeightX constraints set to 0.

 


Attachment: GridBagLayoutSample2015427948modified_886dc1df.zip


SN Sudharsan Narayanan Syncfusion Team March 8, 2022 04:04 AM UTC

Hi David,

We can be able to reproduce the reported issue from our end and we have logged a bug report on this. The issue for this fix is available by Patch on 28th March 2022. You can track the status of the issue using the feedback link below.   

Feedback: https://www.syncfusion.com/feedback/33143/column-width-is-not-work-when-fill-type-is-changed-in-designer-form


Regards,
Sudharsan



GT Gokul Thanudhas Syncfusion Team April 13, 2022 04:10 PM UTC

Hi David,


Fill type specified when initializing the instance will work as expected. However, runtime change for this property will not refresh the layout when there are multiple columns. This is the expected behavior of our the control, hence we are declining your request.

Sorry for the inconvenience caused.


Regards,

Gokul T



DF David Frischknecht replied to Gokul Thanudhas April 13, 2022 04:20 PM UTC

This issue is about changing the value at design-time, not runtime.  Anyway, it's already been fixed as stated in the post above yours.



GT Gokul Thanudhas Syncfusion Team June 24, 2022 04:47 AM UTC

Hi David,


Sorry for the delay in getting back to you.


We regret to inform you that currently, we don’t have support to change layout of the Child Control at design time after initialization. But it will work fine when setting in codebehind


We have analyzed your requirement of “support to change layout of the Child Control at design time after initialization”. We have logged a feature request for the same. We will implement this feature in any of our upcoming release.


At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.

Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.


Feedback link:
Support to change the layout of the Child Control at design time after initialization in WinForms | Feedback Portal (syncfusion.com)

If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.


Regards,

Gokul T



Loader.
Up arrow icon