Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView working with External Stylesheet and CssClass

Reply
Thread Tools

GridView working with External Stylesheet and CssClass

 
 
JB
Guest
Posts: n/a
 
      10-02-2009
Hello

I have an external style sheet in my web application. But I want need
fixed headers on my GridView and scroll through the GridView data.

I can do it when I put the following code Style within the <head> </head>:

.header
{
font-weight:bold;
position:absolute;
background-color:White;

}

and put the following in my <HeaderStyle> in my GridView:

<HeaderStyle CssClass="header" Height="20px" />

and lastly comment out my external stylesheet the GridView Header will be
fixed and I can scroll thru the GridView.

The problem is that I need the External stylesheet because I have to
position the GridView on the web page and I have to position all of the other
controls on the web page using the External stylesheet.

I cannot get rid of the external stylesheet is there any work-around that I
can still utilize the style declarations with my external stylesheet?

JB





--
JB
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      10-03-2009
My understanding is that this style doesn't work when you apply your
external stylesheet so you have likely a conflict with other styles declared
in this stylesheet. You could use a tool to find out the conflicting style
(firebug or IE developer tollbar and inspect the style applied to the
header).

--
Patrice

"JB" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> Hello
>
> I have an external style sheet in my web application. But I want need
> fixed headers on my GridView and scroll through the GridView data.
>
> I can do it when I put the following code Style within the <head>
> </head>:
>
> .header
> {
> font-weight:bold;
> position:absolute;
> background-color:White;
>
> }
>
> and put the following in my <HeaderStyle> in my GridView:
>
> <HeaderStyle CssClass="header" Height="20px" />
>
> and lastly comment out my external stylesheet the GridView Header will be
> fixed and I can scroll thru the GridView.
>
> The problem is that I need the External stylesheet because I have to
> position the GridView on the web page and I have to position all of the
> other
> controls on the web page using the External stylesheet.
>
> I cannot get rid of the external stylesheet is there any work-around that
> I
> can still utilize the style declarations with my external stylesheet?
>
> JB
>
>
>
>
>
> --
> JB


 
Reply With Quote
 
 
 
 
Phil Harvey
Guest
Posts: n/a
 
      10-03-2009
Hi JB,

The Height property on HeaderStyle renders a style attribute on the table
row, like this:

<tr class="header" style="height:20px;">

Because you've also specified a CSS class, just add "height: 20px;" to the
header CSS class in your external stylesheet and delete the Height property
from the GridView HeaderStyle properties. This should achieve what you want.

Regards,

-------------
Phil Harvey
www.anotherblog.com


"JB" wrote:

> Hello
>
> I have an external style sheet in my web application. But I want need
> fixed headers on my GridView and scroll through the GridView data.
>
> I can do it when I put the following code Style within the <head> </head>:
>
> .header
> {
> font-weight:bold;
> position:absolute;
> background-color:White;
>
> }
>
> and put the following in my <HeaderStyle> in my GridView:
>
> <HeaderStyle CssClass="header" Height="20px" />
>
> and lastly comment out my external stylesheet the GridView Header will be
> fixed and I can scroll thru the GridView.
>
> The problem is that I need the External stylesheet because I have to
> position the GridView on the web page and I have to position all of the other
> controls on the web page using the External stylesheet.
>
> I cannot get rid of the external stylesheet is there any work-around that I
> can still utilize the style declarations with my external stylesheet?
>
> JB
>
>
>
>
>
> --
> JB

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with GridView.CssClass and Selections Jonathan Wood ASP .Net 1 05-11-2008 11:52 PM
Firefox and XSLT (local stylesheet works, server-based stylesheet fails) David Blickstein XML 14 10-15-2005 11:27 PM
xml:stylesheet use in document with multiple stylesheet options David Blickstein XML 3 08-02-2005 03:10 PM
have a stylesheet generate another stylesheet based on XML? Steven An XML 1 11-23-2004 01:07 PM
Stylesheet referanse i stylesheet =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?= XML 3 07-04-2004 03:16 PM



Advertisments