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

Radgrid Borde color with skin

3 Answers 219 Views
AJAX and Web 2.0
This is a migrated thread and some comments may be shown as answers.
Dayana Maliyakal
Top achievements
Rank 1
Dayana Maliyakal asked on 26 Apr 2012, 06:16 AM
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

 

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 27 Apr 2012, 09:24 AM
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.
0
nazeer
Top achievements
Rank 1
answered on 18 Jun 2012, 01:39 PM
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
0
Pavlina
Telerik team
answered on 18 Jun 2012, 02:32 PM
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.
Tags
AJAX and Web 2.0
Asked by
Dayana Maliyakal
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
nazeer
Top achievements
Rank 1
Share this question
or