Skip to content

Fix visibility logic for addNewPanel in DesignBindingPicker to use _dataSourceProviderService - #14133

Merged
LeafShi1 merged 2 commits into
dotnet:mainfrom
LeafShi1:Fix_14132_Update_DesignBindingPicker
Aug 31, 2026
Merged

LeafShi1 merged 2 commits into
dotnet:mainfrom
LeafShi1:Fix_14132_Update_DesignBindingPicker

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Dec 11, 2025 •

Copy link
Copy Markdown
Member

Fixes #14132

Proposed changes

  • Re-enable the visibility logic for _addNewPanel in DesignBindingPicker

Customer Impact

  • Previously, the visibility logic for _addNewPanel was commented out(Port DataGridviewDesigner to runtime #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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the visibility logic for the _addNewPanel in the DesignBindingPicker control to properly respect the data source provider service's capabilities. The change restores behavior that aligns with .NET Framework by ensuring the "Add new Object Data Source" panel only appears when the data source provider service is available and supports adding new data sources.

Key Changes

  • Re-enabled the previously commented-out visibility logic for _addNewPanel in the Pick method
  • Updated the variable reference from the non-existent dspSvc to the correct field _dataSourceProviderService

@codecov

codecov Bot commented Dec 11, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.16231%. Comparing base (5d64bba) to head (ab21b9a).
⚠️ Report is 261 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%) ⬆️
integration 19.01538% <0.00000%> (?)
production 52.03610% <75.00000%> (+2.57665%) ⬆️
test 97.40749% <ø> (ø)
unit 49.43741% <75.00000%> (-0.02204%) ⬇️

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

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

SimonZhao888
SimonZhao888 previously approved these changes Dec 12, 2025

@ricardobossan ricardobossan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All LGTM!

@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Apr 22, 2026

@KlausLoeffelmann KlausLoeffelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@LeafShi1
LeafShi1 merged commit 554fc93 into dotnet:main Aug 31, 2026
@dotnet-policy-service dotnet-policy-service Bot removed the waiting-review This item is waiting on review by one or more members of team label Aug 31, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 1, 2026
abineshPalanisamy pushed a commit to abineshPalanisamy/winforms that referenced this pull request Sep 3, 2026
…ataSourceProviderService (dotnet#14133)

## Proposed changes

- Re-enable the visibility logic for _addNewPanel in DesignBindingPicker 


<!-- We are in TELL-MODE the following section must be completed -->

## Customer Impact

-  Previously, the visibility logic for _addNewPanel was commented out(dotnet#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.
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

5 participants