Click here to Skip to main content
12,248,777 members (43,718 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
how to Styling a GridView's rows and cells with CSS IN ASP.NET
Posted 13-Oct-12 8:36am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

<asp:gridview ID="Gridview1" runat="server">
    <AlternatingRowStyle CssClass="" />
    <EditRowStyle  CssClass=""/>
    <FooterStyle CssClass=""/>
    <HeaderStyle CssClass=""/>
    <PagerStyle CssClass=""/>
    <RowStyle CssClass=""/>
    <SelectedRowStyle CssClass=""/>
    </asp:gridview>


Create css for each of the above sections and apply
  Permalink  
Comments
ridoy 13-Oct-12 14:15pm
   
good..+5
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

Hi,
You can use CSS3 properties as they apply to usual HTML table: refer to my Tips posted on Codeplex (links follow):
  1. Alternate Rows in ASP.NET GridView, HTML5 Tables[^]
  2. Fixed Table Header atop scrollable GridView in ASP.NET[^]
  3. HTML5 Tables formatting: alternate rows, color gradients, shadows[^]
  4. Nested GridView controls in ASP.NET: best practices[^]
  5. Click/select Row in ASP.NET GridView or HTML Table[^]
Also, I will recommend to look at Solution 1 posted above in regards to formatting particular table elements like selected rows.

Kind regards,
AB
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

I think you'd better use the ListView control. because it will not render anything by default and you can form it as you want.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

thanks all to answer my question..
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 14 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100