How to insert Controls at a specific location within the Controls collection when building a dynamic table.
Posted on 2011-02-21
I am building a dynamic table which contains multiple rows and each cell contains 7 cells. One of the cells has 2 textboxes. I want to add a label to that cell at runtime. Currently I am only using "add" so it is the last control in. How can I insert the label before the first TextBox?
At present I am doing
If I want to add it before Textbox2 I do the following
Is there not a better way of inserting a control at a specific location in the collection without removing controls?