I am asking for a programming approach.
This is my problem:
I have a WPF window, with a ComboBox at the top.
When user select the item in combobox, depends on the selection, the Grid below it will show a corresponding element, for example: if use choose Display from combobox, then the element in Grid will change to a ListView; and when user choose Add from combobox, the element in Grid will change to a form(textboxes).
Should I create several Grid, collapse them, and show them only when user make selection? Or any other more brilliant ideas?
Thanks.
There can be two ways:
You add one panel containing the controls required for each of the items in the combobox. You can hide all of them and on
SelectedIndexChanged, you can show the appropriate panel. This will need more memory, but the implementation is simpler.The other way will be to have a single panel and render the controls in run time on
SelectedIndexChanged. This will need less memory, but will be complex to implement. Also rendering on run time might need some additional time (so the throughput).