Radgrid Borde color with skin

4 posts, 0 answers
  1. Dayana Maliyakal
    Dayana Maliyakal avatar
    27 posts
    Member since:
    Jan 2010

    Posted 26 Apr 2012 Link to this post

    Hi Telerik Team,

    I have a radgrid with skin like Windows7 and I need to set a  border color to rows only in a radgrid.I tried as follows:

     

     

    <telerik:RadGrid ID="rgLeaveType" runat="server" AutoGenerateColumns="False" CellSpacing="0"

     

     

     

    AllowSorting="True" AllowFilteringByColumn="True" OnItemCommand="rgLeaveType_ItemCommand"

     

     

     

    OnItemCreated="rgLeaveType_ItemCreated" OnItemDataBound="rgLeaveType_ItemDataBound"

     

     

     

    OnNeedDataSource="rgLeaveType_NeedDataSource" Skin="Windows7" GridLines="Horizontal"

     

     

     

    BorderColor="Red">

     


     

     

    <telerik:GridButtonColumn FilterControlAltText="Filter column2 column" UniqueName="Delete"

     

     

     

    Text="Delete" ConfirmText="Do you want to delete?" CommandName="Delete">

     

     

     

    <HeaderStyle BorderColor="Red" />

     

     

     

    <ItemStyle BorderColor="Red" />

     

     

     

    </telerik:GridButtonColumn>

     


     

     

    But I get border color to both rows and columns of the grid.How can I set border color to radgrid rows only.?
    Thanks
    Dayana

     

  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 27 Apr 2012 Link to this post

    Hi Dayana,

    To set a border color to rows you can use the CSS code snippet below:
    <style type="text/css">
    div.AddBorders .rgHeader,
    div.AddBorders .rgRow td,
    div.AddBorders .rgAltRow td,
    div.AddBorders .rgFooter td
    {
    border-color: #aaa;
    border-width: 0 0 1px 0; /*top right bottom left*/
    }
    </style>

    You should set CssClass="AddBorders" for RadGrid in order to apply the styles:
    <telerik:RadGrid ID="rgLeaveType" runat="server" AutoGenerateColumns="False" CellSpacing="0"
           AllowSorting="True" AllowFilteringByColumn="True" Skin="Windows7" GridLines="Horizontal"
           BorderColor="Red" CssClass="AddBorders" OnNeedDataSource="rgLeaveType_NeedDataSource">
       </telerik:RadGrid>

    For additional information about how to add/remove borders in RadGrid you can refer to the following code library:
    http://www.telerik.com/community/code-library/aspnet-ajax/grid/how-to-add-or-remove-radgrid-borders.aspx

    Regards,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. nazeer
    nazeer avatar
    27 posts
    Member since:
    May 2009

    Posted 18 Jun 2012 Link to this post

    Hi TelerikTeam,

    I can able to get the Horizontal lines inside the RadGrid.I want Gridlines vertical also.

    Can you please tell me how to apply CSS for Gridline vertical?

    ThankYou
    Shaik Nazeer Hussain
  4. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 18 Jun 2012 Link to this post

    Hello Shaik Nazeer Hussain,

    The project attached in this code library demonstrates how to add horizontal and vertical borders in RadGrid. Can you verify that you have examined it and it is not working for you?

    Regards,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top