HighTechTalks DotNet Forums  

Datagrid Style Question

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Datagrid Style Question in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bill Rossi
 
Posts: n/a

Default Datagrid Style Question - 07-26-2007 , 03:41 PM






I would like to have the line between certain columns in my datagrid darker
or a different color than the other lines between columns. Does anyone know
how to accomplish this? Thanks in advance.

Bill Rossi




Reply With Quote
  #2  
Old   
Teemu Keiski
 
Posts: n/a

Default Re: Datagrid Style Question - 08-01-2007 , 01:13 PM






Hi,

one way is in ItemCreated event (or with GridView in RowCreated event),
trying top set styles directly at the cells. For example:

Protected Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemCreated
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem Then
e.Item.Cells(0).Style("border-left") = "10px solid red"
End If
End Sub


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"Bill Rossi" <Bill.Rossi (AT) ssa (DOT) gov> wrote

Quote:
I would like to have the line between certain columns in my datagrid darker
or a different color than the other lines between columns. Does anyone
know how to accomplish this? Thanks in advance.

Bill Rossi






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.