Detailsview is using edit mode style

I am using css to provide styles to detailsview.It is using edit mode style, While inserting new item(insert mode). It is not using the normail and alternate styles. Can anybody please advise me how to use css file with the detailsview.

 

Thanks


Thanks,
Athma
0
muniappan
5/4/2009 2:56:31 PM
asp.net.client-side 24353 articles. 1 followers. Follow

2 Replies
794 Views

Similar Articles

[PageSpeed] 39

The detailsview has EditRowStyle & InsertRowStyle properties which you can set a CssClass for.  I think that should allow you to set them to whatever CSS class you want.


C# <---> VB.Net Translator
0
MetalAsp
5/4/2009 3:24:15 PM

I am setting thsese properties in the aspx page,

ASPX Page

========== 

<asp:DetailsView ID="dvCategory" runat="server" AutoGenerateRows="False" CssClass="Details-view"

FooterStyle-CssClass="footer" EditRowStyle-CssClass="edit" RowStyle-CssClass ="normal"

PagerStyle-CssClass="pager" HeaderStyle-CssClass="header" AlternatingRowStyle-CssClass="alternate"

CommandRowStyle-CssClass="command" FieldHeaderStyle-CssClass="fieldheader"

DataKeyNames="CatID,StoreID" DataSourceID="EsCategory" CellPadding="4"

Font-Names="Verdana" Font-Size="8pt" GridLines="None" ForeColor="#333333" OnItemCommand="dvCategory_ItemCommand" OnItemInserting="dvCategory_ItemInserting">

<Fields>

<asp:TemplateField HeaderText="Category ID" SortExpression="Cat_ID">

<InsertItemTemplate>

<asp:TextBox ID="CatID" runat="server" MaxLength="8" Text='<%# Bind("CatID") %>'></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="CatID"

ErrorMessage="Category is required">*</asp:RequiredFieldValidator>

</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%# Bind("CatID") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Description" SortExpression="Description">

<EditItemTemplate>

&nbsp;

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="Label5" runat="server" Text='<%# Bind("Description") %>'></asp:Label>

</ItemTemplate>

<InsertItemTemplate>

<asp:TextBox ID="Description" runat="server" Text='<%# Bind("Description") %>' MaxLength="30"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Description"

ErrorMessage="Description is required">*</asp:RequiredFieldValidator>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="External Reference" SortExpression="CatExternalReference">

<InsertItemTemplate>

<asp:TextBox ID="txtInsertCatExternalReference" runat="server" MaxLength="20" Text='<%# Bind("CatExternalReference") %>'></asp:TextBox>

</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="lblInsertCatExternalReference" runat="server" Text='<%# Bind("CatExternalReference") %>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:CommandField ButtonType="Button" ShowInsertButton="True" />

</Fields>

 

</asp:DetailsView>

=======

CSS File

========

.Details-view tr.header

{

color:White;

background-color: #5D7B9D;

height: 20px;

vertical-align:middle;

text-align:center;

font-weight: bold;

}

.Details-view tr.fieldheader

{

font-family: Times New Roman,Tahoma,Arial,Helvetica;

font-size:16px;

background-color: #E9ECF1;

font-weight:bold;

}

.Details-view tr.normal

{

font-family: Times New Roman,Tahoma,Arial,Helvetica;

font-size:16px;

color: #333333;

background-color: #F7F6F3;

}

.Details-view tr.alternate

{

font-family: Times New Roman,Tahoma,Arial,Helvetica;

font-size:16px;

color: #284775;

background-color: White;

}

.Details-view tr.edit

{

font-family: Times New Roman,Tahoma,Arial,Helvetica;

font-size:16px;

background-color: #999999;

}

.Details-view tr.footer

{

color:White;

background-color: #5D7B9D;

font-weight: bold;

}

.Details-view tr.pager

{

color: white;

background-color: #284775;

text-align: right;

}

.Details-view tr.pager a:link

{

color: white;

background-color: #284775;

text-align: right;

}

.Details-view tr.command

{

font-family: Times New Roman,Tahoma,Arial,Helvetica;

font-size:16px;

background-color: #E2DED6;

font-weight:bold;

}

But It is always using the edit style....


Thanks,
Athma
0
muniappan
5/4/2009 3:40:03 PM
Reply:

Similar Artilces:

When to use client side varidation and server side varidation in .net?
In .net or classic web application we can varidate user data either on client isde or server side. How to select which side varidate to be used? Thanks! Generally, I use both client and server validation. I make sure the input is in the correct format and reasonably valid on the client, then I verify the data on the server. The extent of validation also depends on the type of data that I need to validate.Here are a few references:Validating ASP.NET Server ControlsIntroduction to Validating User Input in Web FormsClient-Side Validation for ASP.NET Server ControlsSecurity Checklist...

How to use client-side script(javascript) in DNA using .Net Remoting
Hi all,     It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following, <script> objXmlDoc = new ActiveXObject("Msxml2.DOMDocument"); objHttp = new ActiveXObject("Msxml2.XMLHTTP"); strEnvelope = ?? objHttp.onreadystatechange = function() { ...... }   szUrl = "http://ServerNa...

Editing DetailsView using a Edit button in templtedfield of DetailsView
I have used a button for trigger editing and given command name as 'Edit' to it but I don't understand where to handle the event . can somebody help victor0282: I have used a button for trigger editing and given command name as 'Edit' to it but I don't understand where to handle the event . can somebody help You don't really need to handle the event yourself, but you can jump into the process using the "ModeChanging" or "ModeChanged" event handlers of the DetailsView.Regards,TripleTwenty...

To display data we can use JSON return from WS, but what about edit a list of data and post back, what should be used on client side?
I remember there were a full client side demo back to the ATLAS age, I need edit a list of rows on client side, and post back when all done, What should I do in this case? thanks  Hi, The easiest method is using gridview in updatepanel. Please check out this link for more information: http://www.asp.net/AJAX/Documentation/Live/tutorials/UsingUpdatePanelControls.aspx Best Regards,Sincerely,Jin-Yu YinMicrosoft Online Community Support I use updatepanel in some places. It is good to save data without page post back. But what I need now is a way to do multi ...

Where is the HTML of FormView (in Edit mode) on Client-Side
Hi, I dynamically load a USerControl containing FormView and switch FormView to Edit mode, but with ViewSource of IE, I can't find the HTML part of it? Where is the HTML of the FormView? In a WebResource? Thanks, Ricky.Take nothing on looks; take everything on evidence.- Charles Dickens HTML of form view edite mode will only be loaded when the form view is in edit mode  and not when when the formview in not in edit mode....Vikram www.vikramlakhotia.comPlease mark the answer if it helped you Hi, I got the problem. The HTML Source of IE will not be updated with Dynamically l...

How to write data to a file in client side using javascript or someother client side scripting language.
Hi, I would like to know how to write a data to a client side file using javascript or someother client side scripting language. The file type expected is ini file. txt file would also be appreciable. Thanks in advance.   If the site is a trusted and you are running IE then you could try http://www.w3schools.com/asp/asp_ref_filesystem.asp The Old Sewing FactoryThat twitter nonsense. You can write to the server, but not to the client's machine.  Being able to do so would be a huge security breach.When you ask a question, remember to click "mark as answered"...

How i use Database Server Connection Client Side? [Edit]
Hi. I need to use (share) Database server connection to client, i see some information, but it's confuse for me. (http://edn.embarcadero.com/br/print/38682 - Using server connections). Where i get "ServerConnection" sub-property? Where have to set it? Thank you. Edited by: Francisco Taveras on Nov 4, 2009 2:42 PM Sorry. I posted it on wrong forum. it's DataSnap Forum. Francisco Taveras wrote: > I need to use (share) Database server connection to > client, i see some information, but it's confuse for me. Are you talking about using a mul...

How to use client-side script(javascript) in .Net Remoting
Hi all,     It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following, <script>  objXmlDoc = new ActiveXObject("Msxml2.DOMDocument"); objHttp = new ActiveXObject("Msxml2.XMLHTTP"); strEnvelope = ?? objHttp.onreadystatechange = function() { ......  }    szUrl = &...

Using AJAX and client side scripting with .NET objects?
I'm wanting to use client-side scripting and AJAX with some drop down boxes.  I can't seem to do this with server-side .NET objects... changing the runat tag doesn't do anything either.  How can I expose .NET server objects so that they are affected by java script and AJAX? Depends on what, exactly, you're trying to do with them.  If you just need access to the html properties (e.g. selectedValue), then you simply grab them as if they were their html equivilants (select element) in javascript.  If you want to pass custom properties back and forth (or any .Net property ...

attaching client side script to an edit mode textbox
i have a problem to find out how to do this: i need to be able to attach a client side jscript to a textbox of the row which is put into the edit mode and apply some business rules. There are several rows in my datagrid and when the user clicks 'edit' on a row: that row goes into the 'edit mode' and then he/she will be able to change the value ( which is a decimal number ) in one of the textboxes and then the client side script will have the duty to keep the total of the changed value and the value of the same column of the previous row . To show the situation: -------------Co...

using Detailsview fields from edit mode to create a session variable
Hi all, In short, i am trying to build a Fullname session variable from two fields (First Name & Last Name) entered into a DetailsView in edit mode. I thought this may work in the Iteminserting protected sub   Session ("Fullname") = Detailsview.fields(1).tostring + " " + Detailsview.fields(2).tostring it returns the fields headers perfectly ;-) Can anyone please help. I will also accept help to do this as a SQL trigger on the DB as the session is only used to assit with the insert statement. Hi, Simon: If you work at the ItemInserting event, you can get the input value by...

when to use client side / server side?
Hey, Please can someone tell me when do i need to use a client-side or a server-side? For instance, I have a dropdownlist and when the user choses one of the listitems then click on the button to submit changes,i need first to validate the new value chosen by the user by comparing it with the old value and then redirect the user to the next page if there are no errors or view an error on the other hand! so in this case what's more preferable to use a JScript (client side) or on the click event of the button pressed (server side)! waiting the reply................. thanx in adva...

In datawindow.net,access the database from client side event using javascript
In powerbuilder,for example,a datawindow has two columns:itemno,description. input an itemno,validate it.if not found from the database,return 1 to trigger itemerror event; if found,get the description of the item from the database,and fill it into the column "description". The question is how to fulfill the function in web datawindow,through web service? if so,I need an example to realize it. You will need to use AJAX or make a round trip on item change event. -- Dean Jones CEO PowerObjects http://www.powerobjects.com (612) 339-3355 Ext. 112 TeamSybase * *...

Local Client-side printing using server vb.net code?
Hi,Rather than use the window.print() command which is just a form dump.  I want to use vb.net code to do this as it has all the features necessary.I came across this useful article from developers.com.  http://www.developer.com/net/net/article.php/3102381However, when I run this it throws an exception because there is no default printer attached to the server.  Of course I don't want to print server side - thats no good.  But print client side.  The users would print to whatever print queue on the network they have connected to their own pc.I thought ...

Web resources about - Detailsview is using edit mode style - asp.net.client-side

Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta
In this article, Scott discusses the recently released beta version of Visual Studio 2008 and .NET Framework 3.5 Service Pack 1. He starts with ...

Latest Updates
Latest Updates - Free source code and tutorials for Software developers and Architects.; Updated: 15 Feb 2013

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

<asp:DetailsView ID="grd_empDetails" runat="server" DataSourceID="empDataSource - Pastebin.com
Pastebin launched a little side project called HostCabi.net , check it out ;-) Don't like ads?

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Latest Updates
Latest Updates - Free source code and tutorials for Software developers and Architects.; Updated: 15 Feb 2013

Resources last updated: 12/15/2015 8:35:20 PM