dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.37k stars 968 forks source link

ComboBox Binding Sequence Affecting Binding Ability of Other Controls #9272

Open Alison-97 opened 1 year ago

Alison-97 commented 1 year ago

.NET version

7.0.302

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

The binding ability of the CheckBox control is affected by the sequence of ComboBox binding. If the ComboBox is binded first, the subsequent binding will not work.

https://github.com/dotnet/winforms/assets/97237245/d355b199-8fb3-4df2-8ee4-11b9f99c06cf

Steps to reproduce

  1. Open the sln file and run the WinformApp. Binding Sequence Issue.zip
  2. Click on Button, go to tabPage2.
  3. Toggle the Checkbox and to change the visibility of the Label in the GroupBox. Note that the checkbox is working as intended.
  4. Open the UserControl2.cs file.
  5. Go to Line 35 and move the BindComboBox line above of the two other bindings.
  6. Run the program again by repeating step 1-3.
  7. Note that the toggling of CheckBox is no longer working, where the Label is invisible regardlessly.

Note that when the GroupBox (containing the Label) and CheckBox is in tabPage1 instead of tabPage2 , the ComboBox binding sequence won’t affect the functionality of the CheckBox

  1. Go to Line 79 & 80 in UserControl2.Designer.cs.
  2. Replace the tabPage2 of groupBox and checkBox with tabPage1.
  3. Launch the program and the checkbox is working fine.
merriemcgaw commented 1 year ago

This bug is not a regression from .NET Framework or earlier versions of .NET so we are unable to prioritize it for .NET 8. If the community would like to make a contribution, we'd be happy to look at it, but otherwise it's going to be looked at sometime in .NET 9 timeframe.