I'm looking for information on how to implement a custom naming container for the items in a GridView. My issue is that I have a GridView with a cell for each day of the week, and each cell will contain the same or similar controls. For the controls that are the same, it'd be nice to name them all the same, such as "lblPersonName".
However, if you do that, you cannot use FindControl(), because it will complain that there are controls with duplicate IDs within the row. The root of the issue is that the naming container for controls in a GridView is not the cell of the table (DataControlFieldCell or whatever), but it is the GridViewRow.
I don't know if there's a way to do this, but it'd be nice to be able to swap out the default naming container so that the cell does become the naming container, and then I could just have the same control names.
Granted, the ASPX for this starts to get a little big - I'm starting to wish I had started the project off in ASP.NET MVC....
In any case, I'm open to other alternatives as far as how to implement a GridView with controls like this. At this point it might be cleaner just to use a plain old table and add the controls dynamically...
For clarification: - Each column is defined with an ItemTemplate, and the controls live within the ItemTemplate. - The only way to get it to work right now is to have "lblPersonNameOne", "lblPersonNameTwo", etc.