WPF data binding - DataGridComboBoxColumn and ObjectDataProvider

1.4k views Asked by At

I'm trying to code a WPF 4.0 DataGrid that matches a database table, with two entries in particular GroupID and SectionID... GroupID contains a collection of groups, and SectionID should be built from a table that takes a {GroupID, SectionID} keys and returns section information.

Binding the DataGridComboBoxColumn to the groups table to show the group names is easy using an ObjectDataProvider, but I can't work out how to do the sections given the fact I need to pass the relevant GroupID for the item into the GetSections() method the ObjectDataProvider is bound to...

Anybody else solved something similar?

1

There are 1 answers

1
Partial On BEST ANSWER

Here is a link that explains a lot about a DataGridComboBoxColumn: link. Also, I would try to bind the DataGrid to an ObservableCollection of a class in which you add properties for each of your columns and then bind each column to a property of the class. By the way I've only done this in C# 3.5...