Home All Groups Group Topic Archive Search About

Change style of Edit-button in GridView?

Author
28 Mar 2006 11:59 AM
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

Author
28 Mar 2006 3:13 PM
sloppycode
I'm having exactly the same problem, today too
Author
28 Mar 2006 3:17 PM
sloppycode
The solution seems to be setting the "AutogenerateEditButton" to false,
and adding an "Edit,Update,Cancel" CommandField column.
Author
29 Mar 2006 7:55 AM
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