Custom Buttons in GridView

The GridView default “AutoGenerate” links are very boring to look at. Here is how to make them buttons. First you will need to make the GridView AutoGenerateEditButton=”false”. Next, inside the <columns> of your gridview, depending on where you want your button to be located you need the following:

<%-- Edit Button --%>
 <asp:commandfield showeditbutton="true" buttontype="Button" />

That will turn the link into a default button. There are many properties of the CommandField to use if you want to make your buttons a image or something else.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s