Monday, November 7, 2011

Control ComboBox ItemSource using another ComboBox in DataGrid

In this post I try to show a detail Idea about how to control the data source in DataGrid ComboBox using another DataGrid ComboBox.

1. I add two resource keys into Data Grid. First resource key help to bind a datasource in ItemType ComboBox and second one help to bind a datasource in ItemName ComboBox according to ItemType ComboBox.

2. In the first data template column I try to bind the enum class as data source in my Item Type ComboBox.

3. In the second data template column in DataGrid bind a static resource as its item source.
This SetValueInBook class return the ItemSource in ComboBox.

4.  I create the Items type List to set the data source into ComboBox.


5. The ItemSourceof Item Name ComboBox,  changed when the selection changed of my Item Type ComboBox. You can set the data source into List item source.

No comments:

Post a Comment