Change style of Edit-button in GridView?

Discussion in 'ASP .Net Web Controls' started by Jo, Mar 28, 2006.

  1. Jo

    Jo Guest

    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
    Jo, Mar 28, 2006
    #1
    1. Advertising

  2. Jo

    Guest

    I'm having exactly the same problem, today too
    , Mar 28, 2006
    #2
    1. Advertising

  3. Jo

    Guest

    The solution seems to be setting the "AutogenerateEditButton" to false,
    and adding an "Edit,Update,Cancel" CommandField column.
    , Mar 28, 2006
    #3
  4. Jo

    Jo Guest

    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
    Jo, Mar 29, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    How to change color,width,style of Edit,Dlete,add of buttontype

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    934
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Oct 5, 2004
  2. =?Utf-8?B?a2Vu?=
    Replies:
    1
    Views:
    10,309
    Wiktor Zychla [C# MVP]
    Jan 23, 2006
  3. Mark B
    Replies:
    0
    Views:
    610
    Mark B
    Apr 6, 2009
  4. Frank Kurka
    Replies:
    8
    Views:
    288
  5. Jaime Stuardo

    GridView control enters edit mode when I click Edit link twice

    Jaime Stuardo, Apr 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    377
    Jaime Stuardo
    Apr 7, 2006
Loading...

Share This Page