dotnet / winforms

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

Bindingsource not assigned #8908

Open r-schaefer opened 1 year ago

r-schaefer commented 1 year ago

Environment

Visual Studio 2022 - 17.5.3

.NET version

7.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

Yes

Issue description

Assigning a class as data source to a binding source doesn't seems to work within the designer. The data source class can be selected but isn't assigned as data source.

see attached sample project and screenshots screen1 screen2 WinFormsAppTestBindingSource.zip

Steps to reproduce

Diagnostics

No response

elachlan commented 1 year ago

CC: @KlausLoeffelmann (designer + databinding)

dreddy-work commented 1 year ago

@Olina-Zhang, can you check if this worked in any versions of .NET core?

Olina-Zhang commented 1 year ago

@Olina-Zhang, can you check if this worked in any versions of .NET core?

It can reproduce in all previous .Net versions. Here is the simple repro steps:

  1. Create a Winforms .Net core application
  2. Add a bindingSource control to form designer, go to this control's properties window, and find DataSource property, open its dropdown, click "Add new Object Data Source..." link
  3. In "Add and update object data source" dialog, uncheck "Only show project defined types", check any one of DataSource in table, click OK button

Result: The chosen dataSource is not updated in DataSource property automatically, it needs to choose it manually. See following gif. @r-schaefer is it your problem? I verified your sample, can find the defined dataSource in DataSource dropdown, but need to choose manually. @dreddy-work @KlausLoeffelmann Could you please see if it is a real issue? source

r-schaefer commented 1 year ago

Yes, I can confirm that this is the problem I reported (Meanwhile I also discovered the solution to manually add the data source).