PDA

View Full Version : Gridview using Select to show Edit/Delete


zombielunch
07-21-2009, 10:39 PM
Is it possible in a GridView to hide the Edit and Delete buttons until a user clicks on the Select button of a row? And to only show the Edit and Delete buttons for the selected row?

Mike_O
07-22-2009, 04:27 PM
Hey zombielunch,

I know you can have an Update and Delete button for the GridView control, but I'm not sure what you mean when you mention the Select button of a row. It must be some business requirement that you have there. Anyway, let's say that if you generate some server-side button in each row, then you can also have a CommandField inside your GridView control, inside which you can set the boolean properties ShowEditButton and ShowDeleteButton. Initially, you can set them to false, and then just have an event handler for the buttons so that when clicked, sets those properties to true programmatically, which will expose the Update/Delete buttons.

Regards,
Mike