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. Advertisements

  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, Aug 1, 2007
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.