winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Fix visibility logic for addNewPanel in DesignBindingPicker to use _dataSourceProviderService

Open LeafShi1 opened this issue 1 month ago • 1 comments

Fixes #14132

Proposed changes

  • Re-enable the visibility logic for _addNewPanel in DesignBindingPicker

Customer Impact

  • Previously, the visibility logic for _addNewPanel was commented out(https://github.com/dotnet/winforms/pull/9677), causing the panel to remain always visible, regardless of whether adding new data sources was supported.
  • This behavior diverged from .NET Framework, where visibility depends on the data source provider service and its capability to add new data sources.
  • The incorrect logic could mislead developers by showing an option that is not actually supported at runtime.
  • Restoring the original conditional logic ensures consistency with .NET Framework and improves design-time accuracy.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

The "Add new Object Data Source" link & description shouldn't display in the DropDown panel for the DataSource & DisplayMember properties in the propertiGird

image

After

image

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-rc.3.25603.106
Microsoft Reviewers: Open in CodeFlow

LeafShi1 avatar Dec 11 '25 10:12 LeafShi1

Codecov Report

:x: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 77.16231%. Comparing base (5d64bba) to head (ab21b9a). :warning: Report is 7 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14133         +/-   ##
===================================================
+ Coverage   76.01271%   77.16231%   +1.14960%     
===================================================
  Files           3279        3279                 
  Lines         645325      645328          +3     
  Branches       47720       47721          +1     
===================================================
+ Hits          490529      497950       +7421     
+ Misses        145491      143695       -1796     
+ Partials        9305        3683       -5622     
Flag Coverage Δ
Debug 77.16231% <75.00000%> (+1.14960%) :arrow_up:
integration 19.01538% <0.00000%> (?)
production 52.03610% <75.00000%> (+2.57665%) :arrow_up:
test 97.40749% <ø> (ø)
unit 49.43741% <75.00000%> (-0.02204%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Dec 11 '25 11:12 codecov[bot]