CssClass on DataGrid Edit, Update & Cancel buttons

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

  1. I have a DataGrid with an EditCommandColumn column set to a type of PushButton. I want to set set CssClass on these buttons and cannot without using code-behind code on the ItemDataBound event. The project lead does not want me to do this with code as he thinks it is too complex. But I cannot find a property in Design View or HTML View that works. Otherwise the edit buttons do not match the appearance of other buttons on the screen.

    Here is the HTML definiton of the web form:

    <body>
    <form id="Form1" method="post" runat="server">
    <TABLE id="tblDetail" style="HEIGHT: 34px" cellSpacing="1" cellPadding="1" width="99%"
    border="0">
    <TR>
    <TD width="120"><INPUT class="Buttons" id="clientBtnClose" onclick="CloseWindow();" type="button" value="Close Window"></TD>
    <td><asp:label id="lblErrorMsg" runat="server" ForeColor="Red" Font-Bold="True" BackColor="Transparent"></asp:label></td>
    </TR>
    </TABLE>
    <BR>
    <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>
    </body>


    Thanks in advance!

    Steve Kallal
     
    =?Utf-8?B?U3RldmUgS2FsbGFs?=, 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?SmFjcXVlcyBMZWNsZXJj?=

    RE: Setting CssClass on Edit, Update & Cancel buttons

    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    520
    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=
    Jul 6, 2004
  2. Craig G
    Replies:
    2
    Views:
    696
    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,433
    =?Utf-8?B?cG11ZA==?=
    Dec 28, 2004
  4. bgledet

    Datagrid disappearing on Edit, Update, or Cancel

    bgledet, Apr 27, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    171
    Scott G.
    Apr 27, 2004
  5. Marco Liedekerken
    Replies:
    0
    Views:
    1,122
    Marco Liedekerken
    Nov 8, 2006
Loading...

Share This Page