How to repeat a UI in WPF. I mean if I have dynamic records, and I want to display a UI block with labels and textboxes and other controls for each record how do I do that?
All my data on the window is dynamic, nothing is static,
Record 1 in database: test1 test11
d1 t1 t11
r1 m1 m11
Record 2 in database: test2 test22 test222
d2 t2 t22 t222
r2 m2 m22 m222
k2 k2 k22 k222
I have a big object TEST with all this values eg, test1, test11, d1, r1, t1, t11, m1, m11, etc.
All the rows and columns are dynamic. How will I create an UI for the above requirement.
I am sorry if this is not clear and is too confusing to understand.
This is pretty vague, so the answers will follow suit.
Generically, you use an
ItemsControl(or one if its inheritors) and set itsItemsSourceproperty to the collection of records.You define a
DataTemplatewith everything needed to display a single record.You assign that
DataTemplateas theItemsControl‘sItemTemplate.