开发者

DataGridComboBoxColumn Dynamic Binding

I have a datagrid with a combobox column. I want to bind this column to a list of items that I generate dynamically in the co开发者_运维问答de-behind file. All rows of the datagrid will have the same list of items in the combobox column. I have done static binding using ObjectDataProvider, but I am not sure how to do this dynamically.

Any help is greatly appreciated!

Thank you, Santosh


You can use an ObservableCollection<T> for your items, if you then bind the ItemsSource of the DataGrid to this collection you can dynamically items to the collection and they will also be added to the DataGrid. See the collections binding section on MSDN for more info. If this is not what you are looking for you might want to elaborate as your question still seems quite unclear (at least to me).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜