Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In .NET 8 WinForms, using the PropertyGrid at runtime, the DataSource property of the ComboBox appears disabled. #12560

Closed
ravipoddar10mca opened this issue Nov 28, 2024 · 8 comments
Assignees
Labels
area-controls-PropertyGrid PropertyGrid and editor related issues

Comments

@ravipoddar10mca
Copy link

In .NET 8 WinForms, the DataSource property of the ComboBox appears disabled in the PropertyGrid control.

Image

@elachlan elachlan added area-VSDesigner Windows Forms out-of-proc designer related issues untriaged The team needs to look at this issue in the next triage labels Nov 28, 2024
@elachlan
Copy link
Contributor

@Olina-Zhang can your team please test and confirm?

@Zheng-Li01
Copy link
Member

Zheng-Li01 commented Nov 29, 2024

The issue can reproduce from .NET Core 3.1 to 8.0 for the controls which support the DataSource property, such as ComBobox, DataGridView, ListBox, BingingSource etc. cannot reproduce NET 9.0 & latest 10.0 as below screenshot. but for .NET 9.0 & 10.0, the "Add new Object Data Source..." function cannot be used.

Image

@elachlan
Copy link
Contributor

@Zheng-Li01 Is there a designer issue for this?

@Zheng-Li01
Copy link
Member

@Zheng-Li01 Is there a designer issue for this?

Sorry about this, have correct my test results. please have a check.

@ravipoddar10mca
Copy link
Author

Please solve this issue in .NET8

@ravipoddar10mca
Copy link
Author

@elachlan @Zheng-Li01

Is there any workaround for that ?? and when we expect the resolution in .NET8

@KlausLoeffelmann KlausLoeffelmann self-assigned this Dec 3, 2024
@merriemcgaw merriemcgaw added area-controls-PropertyGrid PropertyGrid and editor related issues and removed area-VSDesigner Windows Forms out-of-proc designer related issues untriaged The team needs to look at this issue in the next triage labels Dec 3, 2024
@KlausLoeffelmann KlausLoeffelmann changed the title In .NET 8 WinForms, the DataSource property of the ComboBox appears disabled in the PropertyGrid control. In .NET 8 WinForms, using the PropertyGrid at runtime, the DataSource property of the ComboBox appears disabled. Jan 28, 2025
@KlausLoeffelmann
Copy link
Member

I am not entirely sure what folks would expect here.
The functionality which we provide in the Visual Studio Out-Of-Proc Designer is bound to Visual Studio, and not part of the runtime.

Please note that every functionality which is ultimately shown in the Property Grid is controlled by the respective TypeEditors.

When we needed a different approach in .NET 6+, we rerouted the path to get the DataSource's TypeEditor. That is always an option to do that, if not - for different domain-specific scenarios - a necessity.

So, I did not watch the changes around this. But going forward, we could have a StringEditor for any DataSource property at best.

If you want to have something specific, it's comparatively easy to do that.

Here are a couple of resources to read on from. This is all very well documented!

https://learn.microsoft.com/dotnet/api/system.drawing.design.uitypeeditor?view=windowsdesktop-9.0

What's important is:
This scenario is documented for design-time but will for .NET Core only work at runtime.
That is expected and also documented:

https://learn.microsoft.com/dotnet/desktop/winforms/controls-design/designer-differences-framework?view=netdesktop-9.0

If you need more background, why this works that way, take a look at this blog post I wrote quite a while ago:

https://devblogs.microsoft.com/dotnet/custom-controls-for-winforms-out-of-process-designer/

If you have additional questions, or if I have missed anything around this, please follow up.

Thanks!

@KlausLoeffelmann
Copy link
Member

Closing this as won't fix because it's not a bug.
If you feel this is a bug, feel free to reopen this, and we can discuss this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-PropertyGrid PropertyGrid and editor related issues
Projects
None yet
Development

No branches or pull requests

5 participants