This question is locked. New answers and comments are not allowed.
Hi,
I'm developing a time reporting system where the user reports time agains projects.
A project is connected to one and only one customer, but a customer can have several projects.
I have two GridViewComboBoxColumns, Project and Customer that are bound to ObservableCollections in the view model.
When the user adds a new row, both ComboBoxes display all active projects and all customers.
But then I need some smart filtering.
If a user selects a project, the connected customer should automatically be set. That I have already fixed.
The other way around is my problem,.
If the user instead selects a customer, the Project ComboBox should be filtered so that only projects connected to that customer is displayed in the drop down.
And of cource this should only affect the current row.
I have seen some examples here on the forum about creating a collection on the business object that holds availale projects.
But there can be hundreds of projects, and many many rows in the grid so it does not seem to be a good performance solution.
Isn't there anyway I can set the ItemsSource for the ComboBox in code behind instead and filter it for each row?
Regards,
Håkan
I'm developing a time reporting system where the user reports time agains projects.
A project is connected to one and only one customer, but a customer can have several projects.
I have two GridViewComboBoxColumns, Project and Customer that are bound to ObservableCollections in the view model.
When the user adds a new row, both ComboBoxes display all active projects and all customers.
But then I need some smart filtering.
If a user selects a project, the connected customer should automatically be set. That I have already fixed.
The other way around is my problem,.
If the user instead selects a customer, the Project ComboBox should be filtered so that only projects connected to that customer is displayed in the drop down.
And of cource this should only affect the current row.
I have seen some examples here on the forum about creating a collection on the business object that holds availale projects.
But there can be hundreds of projects, and many many rows in the grid so it does not seem to be a good performance solution.
Isn't there anyway I can set the ItemsSource for the ComboBox in code behind instead and filter it for each row?
Regards,
Håkan