I’m maintaining an ASP.Net 2.0 website that displays products in a GridView. The client has asked if I can display an ‘Add to Cart’ button every 10th row. I could do this by putting the button in its own column and flipping the visibility but I wondered if I could inject a new row after every 10 items. This puts the button on a row of its own and doesn’t take up column space when it’s not visible. Any thoughts on how to do this? TIA
I’m maintaining an ASP.Net 2.0 website that displays products in a GridView. The client
Share
It is notoriously difficult to insert rows into a GridView. Have you thought about using a Repeater?
Given the following markup:
You could use the following code-behind to insert a custom control after whichever rows you so choose: