Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Simple style sheet / ASP question

Reply
Thread Tools

Simple style sheet / ASP question

 
 
Roy
Guest
Posts: n/a
 
      08-02-2005
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(.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 ***
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      08-02-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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(.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 ***



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic ASP style sheet not working Suba ASP .Net 3 03-06-2008 05:40 PM
Content Page specific style style sheet rshillington@gmail.com ASP .Net 0 07-14-2006 03:45 PM
Style Sheet Asp.Net Colin Graham ASP .Net 3 04-16-2005 03:33 PM
css style sheet with asp code weiwei ASP General 4 09-18-2004 01:33 PM
Using Style Sheet with Asp.Net Selden McCabe ASP .Net 1 07-08-2004 05:42 PM



Advertisments