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 Marcin Kozub 275
1 OriginalGriff 264
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.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