Nested Repeaters
Orsan Awawdi
Software Engineer | Extensive experience in automation using Python and Jenkins
Let's take an example. We have Categories table in our DB, and each Category has multiple subcategories. How can I bind these into our web page, letting the user select one or more subcategory?
So, first I will establish an "outer" repeater that holds the Category data. Then an "inner" repeater that holds the Subcategory data. Should look like this
Now, let's bind the outer repeater with our Categories data
For each Category, we need to link the relevant Subcategory. So we bind the inner repeater, this time with the ID of the relevant Category, which is stored in Hidden Field component.
All we need to do is to catch the Checkbox inside the "inner" repeater, so we can verify it is selected. This can be done by looping the two repeaters in a nested for-each. In case the checkbox IS selected, we are free to do our whatever manipulation needed.