Let's assume that you have
- an array of N integers
- an integer value representing number of rows
in the model. The integer is bound to a ComboBox in the view.
Q1) How do you bind the array (or individual items of the array) to a DataGrid or a ListView control so that:
- when you change the ComboBox value, only that many rows are visible/generated in the DataGrid or ListView
- Individual rows of the DataGrid or ListView contain TextBoxes (or similar) that allow to edit the corresponding value in the array. The binding must be two-way.
I.e. If i select 5 in the ComboBox, only 5 rows are visible containing 5 TextBoxes that are each bound to the first 5 items of the array.
Q2) How would you provide another column (only text information) to the DataGrid / ListView so that:
- First row would always read 0. Each subsequent row would read: 'previous row' + '360 divided by ComboBox selected value' (providing that it would be limited to even numbers for simplicity).
Any help or suggestions are really appreciated.
Thank you.
EDIT (22.11.2013):
Following suggestions of Sheridan I am linking this question to my other question that has more information (and context) to this question.
Originally I opened this question because I thought that a question stripped down of any context just to the bare mechanics would get better understanding and better chance to being answered.
I stand corrected.