468,720 Members | 1,732 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,720 developers. It's quick & easy.

CssClass on DataGrid Edit, Update & Cancel buttons

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
Nov 18 '05 #1
0 1243

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sudha | last post: by
2 posts views Thread by Sebi | last post: by
9 posts views Thread by tshad | last post: by
4 posts views Thread by rkbnair | last post: by
1 post views Thread by Aayush Puri | last post: by
5 posts views Thread by Tina | last post: by
9 posts views Thread by rn5a | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Oskars | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.