GridView working with External Stylesheet and CssClass

Discussion in 'ASP .Net' started by JB, Oct 3, 2009.

  1. JB

    JB Guest

    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
     
    JB, Oct 3, 2009
    #1
    1. Advertising

  2. JB

    Patrice Guest

    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" <> a écrit dans le message de
    news:...
    > 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
     
    Patrice, Oct 3, 2009
    #2
    1. Advertising

  3. JB

    Phil Harvey Guest

    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
     
    Phil Harvey, Oct 3, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=

    Stylesheet referanse i stylesheet

    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=, Jul 3, 2004, in forum: XML
    Replies:
    3
    Views:
    616
    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=
    Jul 4, 2004
  2. Steven An
    Replies:
    1
    Views:
    541
    Martin Honnen
    Nov 23, 2004
  3. David Blickstein
    Replies:
    3
    Views:
    1,089
    David Blickstein
    Aug 2, 2005
  4. David Blickstein
    Replies:
    14
    Views:
    6,448
    Harrie
    Oct 16, 2005
  5. Jonathan Wood
    Replies:
    1
    Views:
    658
Loading...

Share This Page