473,779 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CssClass on DataGrid Edit, Update & Cancel buttons

I have a DataGrid with an EditCommandColu mn 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"><IN PUT class="Buttons" id="clientBtnCl ose" onclick="CloseW indow();" type="button" value="Close Window"></TD>
<td><asp:labe l id="lblErrorMsg " runat="server" ForeColor="Red" Font-Bold="True" BackColor="Tran sparent"></asp:label></td>
</TR>
</TABLE>
<BR>
<asp:datagrid id="grdCycleSta tusList" runat="server" Width="99%" ShowFooter="Tru e" AutoGenerateCol umns="False"
DataKeyField="C ycleStatusID" CssClass="DataG rid" BorderColor="#4 A3C8C">
<AlternatingIte mStyle CssClass="DataG ridAlternatingI tem"></AlternatingItem Style>
<ItemStyle CssClass="DataG ridItem"></ItemStyle>
<HeaderStyle CssClass="DataG ridHeader"></HeaderStyle>
<Columns>
<asp:TemplateCo lumn HeaderText="Cyc le Description">
<ItemTemplate >
<asp:Label id=Label1 runat="server" Text='<%# DataBinder.Eval (Container, "DataItem.Statu sDescription") %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate >
<asp:TextBox id="txtCycleDes cription_ADD" CssClass="Edit" Runat="server"> </asp:TextBox>
<asp:RequiredFi eldValidator id="rfvDescript ion_Add" runat="server" Text="Required" ControlToValida te="txtCycleDes cription_ADD"
Display="Dynami c"></asp:RequiredFie ldValidator>
</FooterTemplate>
<EditItemTempla te>
<asp:TextBox id=txtCycleDesc ription runat="server" CssClass="Edit" Text='<%# DataBinder.Eval (Container, "DataItem.Statu sDescription") %>'>
</asp:TextBox>
<asp:RequiredFi eldValidator id="rfvDescript ion_Edit" runat="server" Text="Required" ControlToValida te="txtCycleDes cription"
Display="Dynami c"></asp:RequiredFie ldValidator>
</EditItemTemplat e>
</asp:TemplateCol umn>
<asp:EditComman dColumn ButtonType="Pus hButton" UpdateText="Upd ate" HeaderText="Edi t" CancelText="Can cel"
EditText=" Edit ">
<ItemStyle CssClass="Butto ns"></ItemStyle>
</asp:EditCommand Column>
<asp:TemplateCo lumn>
<FooterTemplate >
<asp:Button id="btnAddNew" Width="100%" CssClass="Butto ns" Text="Add" Runat="server" CommandName="AD D_NEW"></asp:Button>
</FooterTemplate>
</asp:TemplateCol umn>
</Columns>
</asp:datagrid></form>
</body>
Thanks in advance!

Steve Kallal
Nov 18 '05 #1
0 1467

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

Similar topics

0
963
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 Edit then update , cancel buttons text comes with my own text and if there i update means then it comes back to Edit and it does nt contain my own text and if press i cancel then no problem, problem only when i press update button then Edit button...
2
3156
by: Sebi | last post by:
Hello all is it possible to add a checkbox in a DataGrid for Boolean Data? Thanks in advance
9
4608
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 consistant. Thanks, Tom.
3
2284
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 "Submit" button, only those records are displayed where company name matches with user input. I need the datagrid to be editable. For this i used the walkthrough from ..NET "Using a datagrid for reading & writing data to database" or it was some...
4
6947
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
1525
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 Button when a user wants to edit the datagrid. What I found confusing was the use of databinding when this cancel button is pressed. When we are pressing the Cancel button we are not changing the datasource...then why do we need to re-bind the web...
5
2056
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 time property of causevalidation. How can I keep them from causing validation? Thanks, T
1
1622
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 items does not appear. I have to click on the edit once again for the items to change. Same thing happens when i click on the update & cancel buttons. I found that though the event handler gets executed the first time (in all 3 cases) , it does not...
9
2729
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 code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
0
9471
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10136
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.