Search code examples
c#asp.netgridviewitemtemplatetemplatefield

TemplateField ItemTemplate only showing after postback


I'm creating a GridView dynamically in the code behind for a variable row/columns GirdView. Each cell contains 1 or 2 DropDownLists. I have verified that all the code is being hit as expected, however on the initial page load none of the DropDownLists appear. They only appear after I make adjustments in other controls causing a postback, and then all DropDownLists appear as expected.

Any suggestions as to where my issue could be?


Solution

  • I realized that my gridview manipulation was only happening during initial load, and specific events, not all post backs.

    I added the gridview manipulation to all loads and it works.