Adding a phantom item to a databound combo box?
-
I have the need to add a phantom "All Selections" item to a databound combo box, but inserting a new item into the data binding source results in source collection also having the "All Selections" item throughout the entire project, which is not desired. So what's the best practice way of inserting a phantom item into a data bound combo box, so it doesn't mess up the underlying data source?
-
I have the need to add a phantom "All Selections" item to a databound combo box, but inserting a new item into the data binding source results in source collection also having the "All Selections" item throughout the entire project, which is not desired. So what's the best practice way of inserting a phantom item into a data bound combo box, so it doesn't mess up the underlying data source?
You can create a class which wraps the actual data source, and exposes an augmented version of the data source with the extra item(s) in the list. Then bind the ComboBox to an instance of the wrapper class. Josh