hello there... wondering if anyone has run into this problem... but as I have articulated the problem for this post, I realized a solution, test it, and it works, so I will post the issue and my solution here.
I have created a Table control with 8 rows at design time. I have a dropdown menu whose SelectedIndexChanged event adds rows to that Table control programmatically. But when I iterate through that Table, I am not able to access the rows (and the TextBox values in each row).
I know that dynamic rows have to be re-constructed on each postback, so to solve my problem, I took the code that dynamically adds the rows to the Table control from the ddlBenefitGroup_SelectedIndexChanged method and created a new AddNewRows method using that code... leaving the ddlBenefitGroup_SelectedIndexChanged method body empty.
Then, in the Page_Load method, I check to see if the page is a postback or not... if it is, I call the AddNewRows method. Since the ddlBenefitGroup_SelectedIndexChanged automatically sets a postback, my if branch in the Page_Load method takes care of business... or any other control that posts back will automatically reconstruct the rows added.
I have created a Table control with 8 rows at design time. I have a dropdown menu whose SelectedIndexChanged event adds rows to that Table control programmatically. But when I iterate through that Table, I am not able to access the rows (and the TextBox values in each row).
I know that dynamic rows have to be re-constructed on each postback, so to solve my problem, I took the code that dynamically adds the rows to the Table control from the ddlBenefitGroup_SelectedIndexChanged method and created a new AddNewRows method using that code... leaving the ddlBenefitGroup_SelectedIndexChanged method body empty.
Then, in the Page_Load method, I check to see if the page is a postback or not... if it is, I call the AddNewRows method. Since the ddlBenefitGroup_SelectedIndexChanged automatically sets a postback, my if branch in the Page_Load method takes care of business... or any other control that posts back will automatically reconstruct the rows added.