Best way to 'search' controls on a panel
Posted on 2007-11-30
I have a form's tab that displays a table.
In that table, I will have x number of rows.
On each row, I'll have a checkbox, and two combos. The names of each are very similar but unique to any additional rows.
I now have my code displaying these and functioning the way I want, so it's time to take the data there and drop it into a database.
My problem: determining the best way to get at those controls and the data the contain...
I have two ideas so far, but wanted to know the more efficient route to take.
Loop through all controls on the panel? (I will have a class-level counter variable to determine how many rows)
Setup a 'hidden' control that would hold the primary name (that all 3 controls in a row are based off of)
Or, some other ingenious method? :^)