Click here to Skip to main content
Rate this: bad
good
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 at 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
0 OriginalGriff 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 14 Oct 2012
Copyright © CodeProject, 1999-2014
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