Change DataGrid Headings color

Discussion in 'ASP .Net' started by tshad, Jun 9, 2006.

  1. tshad

    tshad Guest

    How do I change the color of a particular columns' text (forecolor)?

    I normally do this in my PreRender function for the rows as:

    for each oItem as DataGridItem in DataGrid1.Items
    oLabel = CType(oItem.FindControl("SessionID"),Label)
    oLabel.ForeColor = System.Drawing.Color.Orange
    next

    How do I access the columns HeaderText to make this change?

    Thanks,

    Tom
     
    tshad, Jun 9, 2006
    #1
    1. Advertising

  2. tshad

    Winista Guest

    You can do it in RowCreated or DataBound events for the grid.
    The articles in this link will give you some more info about it.

    http://www.netomatix.com/datagridseries.aspx


    "tshad" <> wrote in message
    news:ODlGN6%...
    > How do I change the color of a particular columns' text (forecolor)?
    >
    > I normally do this in my PreRender function for the rows as:
    >
    > for each oItem as DataGridItem in DataGrid1.Items
    > oLabel = CType(oItem.FindControl("SessionID"),Label)
    > oLabel.ForeColor = System.Drawing.Color.Orange
    > next
    >
    > How do I access the columns HeaderText to make this change?
    >
    > Thanks,
    >
    > Tom
    >
     
    Winista, Jun 11, 2006
    #2
    1. Advertising

  3. tshad

    tshad Guest

    "Winista" <> wrote in message
    news:%...
    > You can do it in RowCreated or DataBound events for the grid.
    > The articles in this link will give you some more info about it.
    >
    > http://www.netomatix.com/datagridseries.aspx


    Good articles, but none of them (at least as far as I could tell) talk about
    how to change a particular columns HeaderText.

    One of the articles talk about how to change the headers as a group, but not
    a particular header, as we can do with a particular cell.

    Thanks,

    Tom
    >
    >
    > "tshad" <> wrote in message
    > news:ODlGN6%...
    >> How do I change the color of a particular columns' text (forecolor)?
    >>
    >> I normally do this in my PreRender function for the rows as:
    >>
    >> for each oItem as DataGridItem in DataGrid1.Items
    >> oLabel = CType(oItem.FindControl("SessionID"),Label)
    >> oLabel.ForeColor = System.Drawing.Color.Orange
    >> next
    >>
    >> How do I access the columns HeaderText to make this change?
    >>
    >> Thanks,
    >>
    >> Tom
    >>

    >
    >
     
    tshad, Jun 13, 2006
    #3
  4. tshad

    Winista Guest

    Here is the link..

    http://www.netomatix.com/development/gridviewformatheader.aspx

    See if it helps.

    "tshad" <> wrote in message
    news:...
    > "Winista" <> wrote in message
    > news:%...
    >> You can do it in RowCreated or DataBound events for the grid.
    >> The articles in this link will give you some more info about it.
    >>
    >> http://www.netomatix.com/datagridseries.aspx

    >
    > Good articles, but none of them (at least as far as I could tell) talk
    > about how to change a particular columns HeaderText.
    >
    > One of the articles talk about how to change the headers as a group, but
    > not a particular header, as we can do with a particular cell.
    >
    > Thanks,
    >
    > Tom
    >>
    >>
    >> "tshad" <> wrote in message
    >> news:ODlGN6%...
    >>> How do I change the color of a particular columns' text (forecolor)?
    >>>
    >>> I normally do this in my PreRender function for the rows as:
    >>>
    >>> for each oItem as DataGridItem in DataGrid1.Items
    >>> oLabel = CType(oItem.FindControl("SessionID"),Label)
    >>> oLabel.ForeColor = System.Drawing.Color.Orange
    >>> next
    >>>
    >>> How do I access the columns HeaderText to make this change?
    >>>
    >>> Thanks,
    >>>
    >>> Tom
    >>>

    >>
    >>

    >
    >
     
    Winista, Jun 14, 2006
    #4
    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. Saravana

    Re: Datagrid headings

    Saravana, Jul 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    456
    Saravana
    Jul 23, 2003
  2. Tracey
    Replies:
    0
    Views:
    368
    Tracey
    Jul 23, 2003
  3. =?Utf-8?B?QWxhbiBMYW1iZXJ0?=

    Headings in the DataGrid Web Control

    =?Utf-8?B?QWxhbiBMYW1iZXJ0?=, Sep 29, 2004, in forum: ASP .Net
    Replies:
    10
    Views:
    743
    =?Utf-8?B?Y29vbHRlY2g3Nw==?=
    Mar 5, 2006
  4. Bazza Formez
    Replies:
    2
    Views:
    386
    Bazza Formez
    Dec 8, 2004
  5. Kamaljeet Saini
    Replies:
    0
    Views:
    447
    Kamaljeet Saini
    Feb 13, 2009
Loading...

Share This Page