473,385 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGrid Border around earch row

I'd like there to be a border around each row of my data-grid but NOT between
the columns. I've tried setting

BorderColor="Black"
BorderStyle="Solid"
BorderWidth="1px"
ItemStyle-BorderColor="Black"
ItemStyle-BorderStyle="Solid"
ItemStyle-BorderWidth="1px"

at the top of the DataGrid element but, for some reason, these have no
effect. Ideas?

Alex

Jun 12 '06 #1
3 4296
You can set the GridLines property to Horizontal instead of "Both"
"Alex Maghen" <Al********@newsgroup.nospam> wrote in message
news:63**********************************@microsof t.com...
I'd like there to be a border around each row of my data-grid but NOT
between
the columns. I've tried setting

BorderColor="Black"
BorderStyle="Solid"
BorderWidth="1px"
ItemStyle-BorderColor="Black"
ItemStyle-BorderStyle="Solid"
ItemStyle-BorderWidth="1px"

at the top of the DataGrid element but, for some reason, these have no
effect. Ideas?

Alex

Jun 12 '06 #2
Thanks for Winista's good suggestion.

Hi Alex,

You can use the "GridLines" property Winista has mentioned to set the
DataGrid(or GridView)'s gridline style, it support none, both, horizental,
vertical ... And actually this property is implemented through the html
<table> element's "rules" attribute (you can also utilize it when you use
pure html <table>):

#11.3.1 Borders and rules
http://www.w3.org/TR/html4/struct/tables.html#h-11.3.1

BTW, if you also want to apply some style onto the gridview/datagrid's
gridline, you'll need to use css style class and gridline's style is not
controlled by the gridview/datagrid(html table)'s border setting. Here is
a simple DataGrid which display only horizental gridlines and set its
gridlines and border color to "red":

========datagrid =========
</div>
<asp:DataGrid ID="DataGrid1" runat="server"
DataSourceID="SqlDataSource1"
GridLines="Horizontal" CssClass="Grid">
</asp:DataGrid>
</form>

======css style==========
.Grid
{
border-style:solid;
border-width: 2px;
border-bottom-color:Red;
border-top-color: Red;
border-left-color:red;
border-right-color:red;
}
.Grid th
{

border-width: 2px;
border-bottom-color:Red;
border-top-color: Red;
border-left-color:red;
border-right-color:red

}

.Grid td
{
border-width: 2px;
border-bottom-color:Red;
border-top-color: Red;
border-left-color:red;
border-right-color:red

}
=========================

Hope this also helps.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 13 '06 #3
Hey Alex,

Does the info in my last reply also help some? If there is still anything
we can help, please don't hesitate to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gilles T. | last post by:
How I can get element ID in the edit mode of datagrid control? If I not in the edit mode, there are no problem. <asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3"...
6
by: Paul | last post by:
not sure if I should post this in the web controls newsgroup but just wondering if there is a way to limit the size of a datagrid and instead of cutting dat off the user will have a scroll down bar...
9
by: tshad | last post by:
Is there a way to use your own image in place of the automatic one that ASP uses when doing editing in your DataGrid pages? We already have a style of button we are using and would like to be...
3
by: Lars Netzel | last post by:
Hi! How can I get ONLY vertical Gridlines WITHOUT a border around the whole grid? I have "GridLines=vertical" and "BorderStyle=None" and still I have a border around the whole grid! /Lars
0
by: tshad | last post by:
I have a DataGrid: <asp:DataGrid AllowPaging="false" AllowSorting="True" AutoGenerateColumns="false" CellPadding="3" CellSpacing="0" ID="DataGrid1" runat="server" ShowFooter="false"
5
by: tshad | last post by:
I have been trying to figure out what the Datagrid is doing to create its formatting. I found that some of my Datagrids have a 3D type of border and sometime it has a straight line. I finally...
1
by: Arpan | last post by:
The output of a DataGrid is nothing but a HTML table. To color or change the width of the outer 4 borders of a DataGrid, one can use the properties "BorderColor" & "BorderWidth" respectively but...
1
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.