Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RE: Setting CssClass on Edit, Update & Cancel buttons

Reply
Thread Tools

RE: Setting CssClass on Edit, Update & Cancel buttons

 
 
=?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=
Guest
Posts: n/a
 
      07-06-2004
Is this what you are looking for?

<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false"></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton runat="server" Text="Update" CommandName="Update" CssClass="SomeClass"></asp:LinkButton
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false" CssClass="SomeClass"></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateColumn>


"Steve Kallal" wrote:

> I have a DataGrid with an EditCommandColumn column set to type PushButton. I need to change the CssClass property on the Edit, Update & Cancel buttons when the grid is in edit mode. I cannot find a way to do this without using code. Otherwise the buttons appear larger than the other controls on the form. I have been able to accomplish this with some code on the grid's ItemDataBound event. But the boss thinks it is too complex. Is there a way to do this in the HMTL definition of the grid? Here is the HTML defintion of the grid:
>
> <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>
>
>
> Thanks in advance!
>
> Steve Kallal
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP CANCEL CANCEL CANCEL Carmen Rosario Computer Support 7 04-06-2005 11:04 PM
CANT see EDIT UPDATE CANCEL Buttons for DATAGRID =?Utf-8?B?cG11ZA==?= ASP .Net 3 12-28-2004 04:07 PM
applying CssClass to Edit/Update/Cancel button in Datagrid Craig G ASP .Net 2 12-14-2004 12:19 PM
CssClass on DataGrid Edit, Update & Cancel buttons =?Utf-8?B?U3RldmUgS2FsbGFs?= ASP .Net 0 07-06-2004 04:59 PM
Problem with Update & Cancel buttons not showing up nib ASP .Net Datagrid Control 1 11-25-2003 09:31 AM



Advertisments