RE: Setting CssClass on Edit, Update & Cancel buttons

Discussion in 'ASP .Net' started by =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=, Jul 6, 2004.

  1. Is this what you are looking for?

    <asp:TemplateColumn>
    <ItemTemplate>
    <asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false"></asp:LinkButton>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:LinkButton runat="server" Text="Update" CommandName="Update" CssClass="SomeClass"></asp:LinkButton
    <asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false" CssClass="SomeClass"></asp:LinkButton>
    </EditItemTemplate>
    </asp:TemplateColumn>


    "Steve Kallal" wrote:

    > I have a DataGrid with an EditCommandColumn column set to type PushButton. I need to change the CssClass property on the Edit, Update & Cancel buttons when the grid is in edit mode. I cannot find a way to do this without using code. Otherwise the buttons appear larger than the other controls on the form. I have been able to accomplish this with some code on the grid's ItemDataBound event. But the boss thinks it is too complex. Is there a way to do this in the HMTL definition of the grid? Here is the HTML defintion of the grid:
    >
    > <asp:datagrid id="grdCycleStatusList" runat="server" Width="99%" ShowFooter="True" AutoGenerateColumns="False"
    > DataKeyField="CycleStatusID" CssClass="DataGrid" BorderColor="#4A3C8C">
    > <AlternatingItemStyle CssClass="DataGridAlternatingItem"></AlternatingItemStyle>
    > <ItemStyle CssClass="DataGridItem"></ItemStyle>
    > <HeaderStyle CssClass="DataGridHeader"></HeaderStyle>
    > <Columns>
    > <asp:TemplateColumn HeaderText="Cycle Description">
    > <ItemTemplate>
    > <asp:Label id=Label1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.StatusDescription") %>'>
    > </asp:Label>
    > </ItemTemplate>
    > <FooterTemplate>
    > <asp:TextBox id="txtCycleDescription_ADD" CssClass="Edit" Runat="server"></asp:TextBox>
    > <asp:RequiredFieldValidator id="rfvDescription_Add" runat="server" Text="Required" ControlToValidate="txtCycleDescription_ADD"
    > Display="Dynamic"></asp:RequiredFieldValidator>
    > </FooterTemplate>
    > <EditItemTemplate>
    > <asp:TextBox id=txtCycleDescription runat="server" CssClass="Edit" Text='<%# DataBinder.Eval(Container, "DataItem.StatusDescription") %>'>
    > </asp:TextBox>
    > <asp:RequiredFieldValidator id="rfvDescription_Edit" runat="server" Text="Required" ControlToValidate="txtCycleDescription"
    > Display="Dynamic"></asp:RequiredFieldValidator>
    > </EditItemTemplate>
    > </asp:TemplateColumn>
    > <asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" HeaderText="Edit" CancelText="Cancel"
    > EditText=" Edit ">
    > <ItemStyle CssClass="Buttons"></ItemStyle>
    > </asp:EditCommandColumn>
    > <asp:TemplateColumn>
    > <FooterTemplate>
    > <asp:Button id="btnAddNew" Width="100%" CssClass="Buttons" Text="Add" Runat="server" CommandName="ADD_NEW"></asp:Button>
    > </FooterTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:datagrid></form>
    >
    >
    > Thanks in advance!
    >
    > Steve Kallal
    >
     
    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=, Jul 6, 2004
    #1
    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?U3RldmUgS2FsbGFs?=

    CssClass on DataGrid Edit, Update & Cancel buttons

    =?Utf-8?B?U3RldmUgS2FsbGFs?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    736
    =?Utf-8?B?U3RldmUgS2FsbGFs?=
    Jul 6, 2004
  2. Craig G
    Replies:
    2
    Views:
    680
    Patrick Olurotimi Ige
    Dec 14, 2004
  3. =?Utf-8?B?cG11ZA==?=

    CANT see EDIT UPDATE CANCEL Buttons for DATAGRID

    =?Utf-8?B?cG11ZA==?=, Dec 28, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,412
    =?Utf-8?B?cG11ZA==?=
    Dec 28, 2004
  4. nib

    Problem with Update & Cancel buttons not showing up

    nib, Nov 19, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    151
    Aneesh
    Nov 25, 2003
  5. Marco Liedekerken
    Replies:
    0
    Views:
    1,083
    Marco Liedekerken
    Nov 8, 2006
Loading...

Share This Page