Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Very Basic help needed with CSS & GridviewVery Basic help needed with CSS & Gridview
Previous
 
Next
New Post
7/4/2007 2:52 PM
 

Hi,

I've developed a module, 1 of the controls is a gridview.

No matter what I've tried I just cannot change the appearance of it. I've never really bother that much with CSS so I'm sure it's something basic.

Here is the code for my gridview:

 

<asp:GridView ID="GridView1" runat="server" DataSourceID="objDataSource" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="ID" OnRowUpdating="GridView1_RowUpdating" OnDataBinding="GridView1_DataBinding" CssClass="Grid">
    <Columns>
    ......   
    </Columns>
    <RowStyle CssClass="GridItem" />
    <HeaderStyle CssClass="GridHeader" />
    <AlternatingRowStyle CssClass="GridAltItem" />
</asp:GridView>

 

I have added the following to the CSS file:

.Grid { border: solid 10px #FFFFFF; }

.Grid td
{
border: solid 1px #FFFFFF;
margin: 1px 1px 1px 1px;
padding: 1px 1px 1px 1px;
text-align: center;
}
.GridHeader
{
font-weight: bold;
background-color: #8b8dbb;
}
.GridItem
{
background-color: #e6e6e6;
}

.GridAltItem
{
background-color: white;
}

 

I'm doing this on my local machine so I've added this to EVERY .css file I can find. As I said I don't really know much about CSS so any help would be great. I'm seriously frustrated

 

Regards,

 
New Post
7/4/2007 3:14 PM
 

btw,

I also added this into the Admin->Site Setting->Style Editor but to no avail.

 

ARRRRGGGGGGH

 
New Post
7/4/2007 3:34 PM
 

hi

Try using the grid views own built in css classes.  If you are using VS or VSE just type in class and the context sensetive menu will load with all the built in classes.

I know this inst a solution to your problem but it will work its just a bit slower

 

Hope that helps


Class Campers -The Home of the Volkswagen camper & Bus Enthusiast
Worlds Cheapest Homes - Need a Cheap Property, cant afford a home
Beeb iPlayer - Need help with the BBC's new iPlayer software
Internet Insurance Quotes - For the the information you will ever require about Insurance
 
New Post
7/4/2007 3:48 PM
 

Hey,

I'm using Visual Web Developer Express. By in class do you mean actually specify the style in the tags?

something like this?

<asp:GridView ID="GridView1" runat="server" DataSourceID="objDataSource" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="ID" OnRowUpdating="GridView1_RowUpdating" OnDataBinding="GridView1_DataBinding" BorderColor="MistyRose" BorderStyle="Ridge" BorderWidth="3px" CssClass="Grid" BackImageUrl="~/Portals/0/DREGS-logo_BIG_trans.gif">

 

This doesn't work either. It only seems to take notice of any style that I apply to the borders.

I can change the style progammatically, but having to do is absurd. Surely?

 
New Post
7/4/2007 10:18 PM
 

Here is what I recommend:

1) Start by adding your CSS class definitions directly in your module control to verify that you have the class names and styles right. You can do this by adding the exact same CSS code you posted here between <style>...</style> tags in the same ascx file where your GridView control is declared. Something like this...

<style>
.Grid { ... }
</style>

<asp:GridView ID="GridView1" runat="server" DataSourceID="objDataSource" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="ID" OnRowUpdating="GridView1_RowUpdating" OnDataBinding="GridView1_DataBinding" CssClass="Grid">
    <Columns>
    ......   
    </Columns>
    <RowStyle CssClass="GridItem" />
    <HeaderStyle CssClass="GridHeader" />
    <AlternatingRowStyle CssClass="GridAltItem" />
</asp:GridView>

2) Once you have the styling working to your satisfaction, drop the <style> tags, and paste the CSS code into a file named module.css. Place this file in the same folder as your module controls. The framework will automatically include a reference to this file (i.e. you do not need to manually add a reference to this file anywhere).

Nik

 


Nik Kalyani
Co-founder
DotNetNuke Corporation
Blog | Twitter | FaceBook
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Very Basic help needed with CSS & GridviewVery Basic help needed with CSS & Gridview


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out