This is a migrated thread and some comments may be shown as answers.

GridDataItem Row Borders

1 Answer 466 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joan
Top achievements
Rank 1
Joan asked on 19 Jun 2013, 04:49 AM
I have a need to set the top and bottom borders for a specific row in a grid. As I can't see how to set just the top and bottom borders, I've tried item.BorderColor, item.BorderWidth, item.BorderStyle and all three show in the generated markup but none actually show on the screen. I'm setting item.Font.Bold also in code behind and this is the only style that is taking effect at the row level.  The styling shows on the screen if I set it on the item cell, but I don't want side borders on the cells.
Is there a way to achieve what I want?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Jun 2013, 09:59 AM
Hi Joan,

Please try the following code snippet.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server"  GridLines="Horizontal"
        OnItemDataBound="RadGrid1_ItemDataBound">
. . . . . . . . . .
 </telerik:RadGrid>

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
 if (e.Item is GridDataItem)
  {
  // Your conditions
     e.Item.CssClass = "bluefont";
  }    
}

CSS:
<style type="text/css">
  .bluefont td
   {
      border-bottom-color: Blue;
      border-top-color: Blue;
   }
</style>


Thanks,
Princy
Tags
Grid
Asked by
Joan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or