468,771 Members | 1,490 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,771 developers. It's quick & easy.

Simple style sheet / ASP question

Roy
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 ***
Nov 19 '05 #1
1 1825
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" <SP*******@gmail.com> wrote in message
news:O8**************@TK2MSFTNGP15.phx.gbl...
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 ***

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Haines Brown | last post: by
5 posts views Thread by amerar | last post: by
33 posts views Thread by amerar | last post: by
8 posts views Thread by pamelafluente | last post: by
10 posts views Thread by pamelafluente | last post: by
1 post views Thread by Looch | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.