?
Solved

ASP.Net 2.0 Gridview and ItemRow Theming

Posted on 2006-04-13
1
Medium Priority
?
620 Views
Last Modified: 2008-02-01
Not really a problem, the setting the named skin for a gridview.  

I've got three types of Item rows, one aligned Left, one Right and one center.

Is there a way using the Theme to set these??

I"ve got the theme for the grid already and it works, but Can't find a way to set the ItemRow Style.
<asp:gridview runat="server" skinID="GridView"
            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"  EnableSortingAndPagingCallbacks="True" PageSize="20">
        <RowStyle BackColor="#FFFBD6" Font-Names="Arial" Font-Size="8pt" ForeColor="Black" Wrap="False" />
        <HeaderStyle BackColor="Maroon" Font-Names="Arial" Font-Size="8pt" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" Wrap="False" />
        <SelectedRowStyle BackColor="LightGray" Font-Bold="True" />
        <FooterStyle BackColor="Maroon" BorderColor="White" Font-Bold="True" Font-Names="Arial" Font-Size="8pt" />
</asp:GridView>
0
Comment
Question by:PTBNA
1 Comment
 
LVL 2

Accepted Solution

by:
knucklesbamm earned 1500 total points
ID: 16449563
You can really only skin at the asp:gridview level. That said, I had a similar issue. I setup multiple skins for gridviews and associated gridviews to the appropriate skin using the SkinID attribute on the gridview tag. Then, for each skin, I associated an exclit CSS class to each gridview I was using. Then, in my CSS, I changed style for each of my rows accordingly.

i.e.

in my .skin file I might have the following:
  <asp:GridView SkinID="MainTable" AlternatingStyle-CssClass="AltRow" HeaderStyle-CssClass="HeaderRow"  />
  <asp:GridView SkinID="OtherTable" AlternatingStyle-CssClass="AltRow" HeaderStyle-CssClass="HeaderRow"  />

in my .css file I might have the following:
  table.MainTable tr.AltRow
  {
    background-color: #0f0f0f;
  }

  table.OtherTable tr.AltRow
  {
    background-color: #f9f9f9;
  }

and in my aspx file, I create the asp:GridView control using the appropriate skin id
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Screencast - Getting to Know the Pipeline
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question