Simple style sheet / ASP question

Discussion in 'ASP .Net' started by Roy, Aug 2, 2005.

  1. Roy

    Roy Guest

    Hey all. All I'm trying to do is get a darn double solid bar in my
    datagrid footer. Doesn't seem to work. Any tips?
    The weird thing is all the other stylesheet attributes work. If I
    increase the font size it's reflected, etc...

    Here's my style sheet code:
    ..Footer
    {
    border-top-style:double;
    border-top-color:Black;
    background-color:Black;
    font-size:11px;
    background-color:wheat;
    font-weight:bold;
    text-align:center
    }

    Here's my code behind (itemdatabound sub):

    Private Sub MyDataGrid_ItemDataBound(ByVal sender As System.Object,
    ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
    MyDataGrid.ItemDataBound

    If e.Item.ItemType = ListItemType.Header Then
    e.Item.Cells(0).Text = ""
    e.Item.Cells(0).Style.Add("BORDER", "none")
    e.Item.Cells(0).BackColor = Color.Wheat

    e.Item.Cells(1).Style.Add("BORDER", "outset")
    e.Item.Cells(2).Style.Add("BORDER", "outset")
    e.Item.Cells(3).Style.Add("BORDER", "outset")
    e.Item.Cells(4).Style.Add("BORDER", "outset")
    e.Item.Cells(5).Style.Add("BORDER", "outset")
    e.Item.Cells(6).Style.Add("BORDER", "outset")
    e.Item.Cells(7).Style.Add("BORDER", "outset")
    e.Item.Cells(8).Style.Add("BORDER", "outset")
    e.Item.Cells(9).Style.Add("BORDER", "outset")
    e.Item.Cells(10).Style.Add("BORDER", "outset")
    e.Item.Cells(11).Style.Add("BORDER", "outset")
    e.Item.Cells(12).Style.Add("BORDER", "outset")
    e.Item.Cells(13).Style.Add("BORDER", "outset")
    e.Item.Cells(14).Style.Add("BORDER", "outset")
    e.Item.Cells(15).Style.Add("BORDER", "outset")
    e.Item.Cells(16).Style.Add("BORDER", "outset")
    e.Item.Cells(17).Style.Add("BORDER", "outset")
    ElseIf e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    ListItemType.AlternatingItem Then


    ElseIf e.Item.ItemType = ListItemType.Footer Then
    e.Item.CssClass = "footer"
    End If
    End Sub

    *** Sent via Developersdex http://www.developersdex.com ***
    Roy, Aug 2, 2005
    #1
    1. Advertising

  2. I think border attribute has no effect on <tr>. Try setting it for the cells
    instead. like you are doing for the header.

    Eliyahu

    "Roy" <> wrote in message
    news:...
    > Hey all. All I'm trying to do is get a darn double solid bar in my
    > datagrid footer. Doesn't seem to work. Any tips?
    > The weird thing is all the other stylesheet attributes work. If I
    > increase the font size it's reflected, etc...
    >
    > Here's my style sheet code:
    > Footer
    > {
    > border-top-style:double;
    > border-top-color:Black;
    > background-color:Black;
    > font-size:11px;
    > background-color:wheat;
    > font-weight:bold;
    > text-align:center
    > }
    >
    > Here's my code behind (itemdatabound sub):
    >
    > Private Sub MyDataGrid_ItemDataBound(ByVal sender As System.Object,
    > ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
    > MyDataGrid.ItemDataBound
    >
    > If e.Item.ItemType = ListItemType.Header Then
    > e.Item.Cells(0).Text = ""
    > e.Item.Cells(0).Style.Add("BORDER", "none")
    > e.Item.Cells(0).BackColor = Color.Wheat
    >
    > e.Item.Cells(1).Style.Add("BORDER", "outset")
    > e.Item.Cells(2).Style.Add("BORDER", "outset")
    > e.Item.Cells(3).Style.Add("BORDER", "outset")
    > e.Item.Cells(4).Style.Add("BORDER", "outset")
    > e.Item.Cells(5).Style.Add("BORDER", "outset")
    > e.Item.Cells(6).Style.Add("BORDER", "outset")
    > e.Item.Cells(7).Style.Add("BORDER", "outset")
    > e.Item.Cells(8).Style.Add("BORDER", "outset")
    > e.Item.Cells(9).Style.Add("BORDER", "outset")
    > e.Item.Cells(10).Style.Add("BORDER", "outset")
    > e.Item.Cells(11).Style.Add("BORDER", "outset")
    > e.Item.Cells(12).Style.Add("BORDER", "outset")
    > e.Item.Cells(13).Style.Add("BORDER", "outset")
    > e.Item.Cells(14).Style.Add("BORDER", "outset")
    > e.Item.Cells(15).Style.Add("BORDER", "outset")
    > e.Item.Cells(16).Style.Add("BORDER", "outset")
    > e.Item.Cells(17).Style.Add("BORDER", "outset")
    > ElseIf e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    > ListItemType.AlternatingItem Then
    >
    >
    > ElseIf e.Item.ItemType = ListItemType.Footer Then
    > e.Item.CssClass = "footer"
    > End If
    > End Sub
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    Eliyahu Goldin, Aug 2, 2005
    #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. Arondelle

    A Style Sheet Question

    Arondelle, Jul 3, 2004, in forum: HTML
    Replies:
    9
    Views:
    580
    Arondelle
    Jul 3, 2004
  2. Kevin
    Replies:
    0
    Views:
    503
    Kevin
    Jul 31, 2003
  3. bjam
    Replies:
    3
    Views:
    438
  4. Replies:
    0
    Views:
    516
  5. Zach

    Style sheet question

    Zach, May 24, 2012, in forum: ASP .Net
    Replies:
    3
    Views:
    622
    Michael Lalonde
    Jun 21, 2012
Loading...

Share This Page