Skip to content

DataGridView: databinding to BindingList<T> should get bound values from T #946

Closed

Description

@itg-assistant

Tiago (ITG) asked 2017-07-19 15:53:39 UTC

Hi Wisej people,

I have this DataGridView that is bound to a BindingSource

this.dataGridView.DataSource = this.employeeListBindingSource;

The DataSource of this BindingSource is a BindingList

this.employeeListBindingSource.DataSource = typeof(BusinessObjects.EmployeeList);

public class EmployeeList : BindingList {}

The attached sample includes a common business class and 2 UI projects, for Windows Forms and for Wisej.

I have an object numbering system that works correctly on Windows Forms (and WPF and whatever) but fails under Wisej.

The Windows Forms DGV instantiates a new Employee every time I move to  a different (new) row. This means it tries to get bound values from the new BO. Of course it sets user entered values on the BO without any issue.

The Wisej DGV only instantiates a new Employee whenever I quit the (old) row. So it doesn't try to get bound values for the new row but only tries to set user entered values on the BO.

I don't think one should use DefaultValuesNeeded when using data binding.

Please help. Is there some option I should use or is it a plain old bug?

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2017-07-19 18:27:00 UTC

    Hi Tiago,

    This "feature" is by design. Winforms creates and destroys the new automatic row every time it gains/loses the focus. Since Wisej has to also try to optimize the communication between the client grid and the server data model, it creates the new row once when the edited values are committed.

    However, I see your point and I think we can use the default values of the BO. Will log and hopefully fix quickly.

    Best,

    Luca

  2. added
    BugSomething is broken or behaving unexpectedly.
    on Jun 12, 2026
  3. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Tiago (ITG) answered 2017-07-19 19:24:42 UTC

    Hi Luca,

    I remember reading something about Wisej optimizing the communication but I didn't think this feature (it's a feature indeed) was the reason for this behaviour. I browsed all DGV's properties and methods looking for some option like DataBindingNeedDefaults or  DataBindingLoadDefaults. So I guess there will be some option to change this behaviour. Nice to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken or behaving unexpectedly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions