change the color of Groupname in panel control

Discussion in 'ASP .Net' started by kaushik, Sep 24, 2008.

  1. kaushik

    kaushik Guest

    hi there,
    i am not able to change the color of Groupname in panel control from
    blue to black. I read somewhere, if i set the forecolour of the panel, both
    the groupingtext and text
    are rendered the same colour but how to turn this from blue to black..

    can anybody show me with codes
    thanks in advance.
    kaushik, Sep 24, 2008
    #1
    1. Advertising

  2. kaushik

    Norm Guest

    On Sep 23, 8:07 pm, "kaushik" <> wrote:
    > hi there,
    > i am not able to change the color of Groupname in panel control from
    > blue to black. I read somewhere, if i set the forecolour of the panel, both
    > the groupingtext and text
    > are rendered the same colour but how to turn this from blue to black..
    >
    > can anybody show me with codes
    > thanks in advance.


    I ran a quick test on this issue. It seems that IE (I am running IE 8
    Beta 2) does not allow the "color" style to cascade into the Grouping
    Text. It work in Firefox and Chrome for me. It helps to understand how
    the GroupingText property renders into HTML. When you set the property
    the Panel renders differently. Below is an example:

    <div id="Panel1" style="color:Blue;">
    <fieldset>
    <legend> Grouping Text</legend>
    Inner text
    </fieldset>
    </div>

    This exact code renders "Grouping Text" as blue in Firefox and Chrome,
    but not in IE. Therefore, the style does not cascade into the Legend
    tag. ;( My solution to this in a similar case is to just use a css
    class: (In the other case, I wanted the colors to be different, they
    are the same here)

    ....
    <style type="text/css">
    /*This will set the style to both the "div" element and the "legend"
    element*/
    .GroupPanel, .GroupPanel Fieldset Legend
    {
    color: Blue;
    }
    </style>
    ....
    <div id="Panel1" class="GroupPanel">
    <fieldset>
    <legend>Grouping Text</legend>
    Inner text
    </fieldset>
    </div>

    This solution worked in all 3 browsers for me.
    Happy coding!

    Norm
    Norm, Sep 25, 2008
    #2
    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. Sundar
    Replies:
    0
    Views:
    392
    Sundar
    Dec 9, 2003
  2. Sridhar Chinta

    styling the GroupName in asp:Panel

    Sridhar Chinta, Jun 29, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    6,370
  3. Ulf Meinhardt
    Replies:
    0
    Views:
    610
    Ulf Meinhardt
    Jul 7, 2009
  4. Robin Wenger
    Replies:
    0
    Views:
    2,927
    Robin Wenger
    Aug 18, 2011
  5. kaushik

    change the color of Groupname in panel control

    kaushik, Sep 23, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    715
    kaushik
    Sep 23, 2008
Loading...

Share This Page