Datagrid Style Question

Discussion in 'ASP .Net Datagrid Control' started by Bill Rossi, Jul 26, 2007.

  1. Bill Rossi

    Bill Rossi Guest

    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
    Bill Rossi, Jul 26, 2007
    #1
    1. Advertising

  2. Bill Rossi

    Teemu Keiski Guest

    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" <> wrote in message
    news:f8atcj$jss$...
    >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
    >
    >
    >
    Teemu Keiski, Aug 1, 2007
    #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. Rob Nicholson
    Replies:
    3
    Views:
    717
    Rob Nicholson
    May 28, 2005
  2. Replies:
    0
    Views:
    2,453
  3. Replies:
    1
    Views:
    785
    Bertilo Wennergren
    Nov 24, 2003
  4. Ken Varn
    Replies:
    0
    Views:
    439
    Ken Varn
    Apr 26, 2004
  5. Roy

    Datagrid within a Datagrid, treeview style....

    Roy, Jan 13, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    10
    Views:
    310
Loading...

Share This Page