473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1434

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sudha | last post by:
Hi all I am updating the content in datagrid and there i have buttons for Edit , update and cancel and changing the text of these buttons what i like , everything is working fine If i press...
2
by: Sebi | last post by:
Hello all is it possible to add a checkbox in a DataGrid for Boolean Data? Thanks in advance
9
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
3
by: pmud | last post by:
Hi, I have an ASP.NET application using C# code. I am using a datagrid to display records from a database based on a user input, i.e a user enters a compnay name in text box & when he clicks a...
4
by: rkbnair | last post by:
Is there any way to display an image button instead of the traditional Edit/Update/Cancel push button in a datagrid (with bound data)?
1
by: Aayush Puri | last post by:
I was going through an article on datagrid control in ASP.NET and found the use of databind a bit confusing. So the default behavior in a editable datagrid row is to show a Update and a Cancel...
5
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design...
1
by: rp13 | last post by:
Hi, I am using a asp:datagrid which is editable. Though I have handlers wired to my edit, update & cancel events, some how when i click on the edit button nothing happens. The edit template...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.