Updating of BindingSource in WinForms does not update Datasource Collection

前端 未结 4 784
广开言路
广开言路 2021-02-14 00:57

I want to display a custom collection in a DataGridView in a Windows Forms app. This custom collection implements ICollection, and IEnumerable

4条回答
  •  伪装坚强ぢ
    2021-02-14 01:19

    You will have to manually call ResetBindings() after the data source changes if you use a container that cannot do that on your behalf.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.resetbindings.aspx

    Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values.

提交回复
热议问题