开发者

How to use BindingSource with not 1 to 1 set of columns between the list and the DataGridView

开发者 https://www.devze.com 2023-04-08 01:50 出处:网络
I have the following situation working with winforms: I defined a DataGridView with X columns.开发者_如何学Python

I have the following situation working with winforms:

  1. I defined a DataGridView with X columns.
  2. 开发者_如何学Python
  3. Bind it to a list containing X-1 columns

    dataGridViewMain.DataSource = _bindingSource; _bindingSource.DataSource = _currentMediaItems;

  4. After a while I update the list and when performing the following call: _bindingSource.DataSource = _currentMediaItems; I get the following error : "At least one of the DataGridView control's columns has no cell template."

Someone can help with a workaround?

thanks!

0

精彩评论

暂无评论...
验证码 换一张
取 消