Change style of Edit-button in GridView?

J

Jo

Hi all,

I have a GridView with AutoGenerateEditButton="True". Next to it, I've
created a delete-button myself (just to take advantage of a
messagebox):

<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat=server
Text="Delete" CommandName="Delete"
OnClientClick="return confirm('Sure?!?')"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField ....>
....
</Columns>

In my stylesheet I've defined that a link should be blue.

In practice: the GridView is shown with the "edit"-button the same
color as the gridview-data (black) and the "delete"-button is blue.

How can I change the appearance of the edit-button?

And a second question: is it possible to get a GridView with the
edit-column at the end in stead of at the beginning of all columns? I
want to use the AutoGenerateEditButton="True" because it's simple to
work with.

Please, anyone who can help me with this?

Thank you in advance!
Jo
 
S

sloppycode

The solution seems to be setting the "AutogenerateEditButton" to false,
and adding an "Edit,Update,Cancel" CommandField column.
 
J

Jo

Hi,

Thanks for you answer.
I did the same and it works fine and as simple as the
AutoGenerateEditButton, with more functionality (e.g. to use a button
or image in stead of a link)

regards,
Jo
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top