button images in the buttoncolumn of a datagrid

S

stuart

Hi again

Hope you can help..

Is there a way to assign an image on the buttons of the buttoncolumn in a datagrid

Cheers
 
K

Ken Cox [Microsoft MVP]

Hey Stuart,

You need to substitue a TemplateColumn and put an imagebutton into it like
this:

<asp:TemplateColumn>
<ItemTemplate>
<asp:ImageButton id="ImageButton1" runat="server"
ImageUrl="http://weatheroffice.ec.gc.ca/weathericons/00.gif"></asp:ImageButton>
</ItemTemplate>
<EditItemTemplate>
<asp:Button id="Button3" runat="server" CommandName="Update"
Text="Update"></asp:Button>&nbsp;
<asp:Button id="Button2" runat="server" CausesValidation="false"
CommandName="Cancel" Text="Cancel"></asp:Button>
</EditItemTemplate>
</asp:TemplateColumn>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top