CssClass on DataGrid Edit, Update & Cancel buttons

G

Guest

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
 

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,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top