dotnet / dotnet/winforms

Custom Binding Sources not seen as a binding source?

Open
#12,361 2 comments 0 reactions 1 assignee Claimed by @KlausLoeffelmann View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### Environment

Version: 17.10.2

### .NET version

.Net 8 in this example, our actual application is running 4.8.

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

It worked in visual studio 2019 as it wasn't using the out of process designer

### Issue description

Out of process designer doesn't correctly identify custom binding sources and therefore inject extra binding sources when attempting to set them up.

### Steps to reproduce

1. Setup project so it uses the out of process designer
2. Add a new class called "MyCustomBindingSource"
3. Inherit System.Windows.Forms.BindingSource
4. Build project
5. Add MyCustomBindingSource to form
6. Set the datasource property as you normally would
Issue 1, the datasource property doesn't get set via the window however this is already logged here: https://github.com/dotnet/winforms/issues/8908

![Image](https://github.com/user-attachments/assets/79a1241d-7336-4026-bd9e-f0afa5ba4b26)

7. Use work around to set the datasource property via the other datasource section
Issue 2, A extra binding source has been added to the form which has been setup correctly and the MyCustomBindingSource datasource property has been set to that bindingsource.
![Image](https://github.com/user-attachments/assets/ce409023-3094-46e4-b7dc-151614826870)

Project can be downloaded here if you want to be able to skip to step 4

[DataBindingIssue.zip](https://github.com/user-attachments/files/17466217/DataBindingIssue.zip)

Regards

### Diagnostics

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.