我想使用綁定源填充DataGridView。問題是我不知道如何將BinarySource DataSource的DataGridViewRow(或任何類型的結構,除了我現在要避免的DataTable)傳遞給BindingSource DataSource,因爲通過這樣做,我可以看到所有的類屬性僅限Cell的內容。此代碼似乎不起作用:如何使用帶有DataGridViewRow列表的BindingSource DataSource?
bindingSource.DataSource = dgvRowsList;
bindingSource.DataMember = "Cells";
datagrid.DataSource = bindingSource;
在此先感謝!
最初我使用AddRows方法傳遞DataGridViewRow的列表。它工作完美無瑕。但是現在我需要使用DataBinding,所以我迷路了。 TypeDescriptor看起來太複雜了,正如你已經提到的那樣。我會等待一個更簡單的解決方案。不管怎麼說,還是要謝謝你。 :) – Fulalas