Skip to content

Bindingsource not assigned #8908

Open
Open

Description

@r-schaefer

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

  • Create a new winform

  • drop / drop a bindingsource to the form

  • create a simple class with one property / member

  • open datasource of the bindingsource property and assign the class with "Add new object data source"

  • select the simple class and press ok

  • expected: the class is assigned as data source

  • current behaviour: the class isn't assigned

Diagnostics

No response

Activity

  1. added
    area-VSDesigner
    untriaged
    on Mar 28, 2023
  2. elachlan commented on Mar 28, 2023

    @elachlan
    Contributor

    CC: @KlausLoeffelmann (designer + databinding)

  3. dreddy-work commented on Mar 28, 2023

    @dreddy-work
    Member

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

  4. removed
    untriaged
    on Mar 28, 2023
  5. Olina-Zhang commented on Mar 29, 2023

    @Olina-Zhang
    Member

    @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

  6. r-schaefer commented on Mar 29, 2023

    @r-schaefer
    Author

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

  7. added
    area-Binding
    on Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-Bindingarea-VSDesigner

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions