Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataGrid Border around earch row

Reply
Thread Tools

DataGrid Border around earch row

 
 
=?Utf-8?B?QWxleCBNYWdoZW4=?=
Guest
Posts: n/a
 
      06-12-2006
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

 
Reply With Quote
 
 
 
 
Winista
Guest
Posts: n/a
 
      06-12-2006
You can set the GridLines property to Horizontal instead of "Both"


"Alex Maghen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      06-13-2006
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>
<aspataGrid ID="DataGrid1" runat="server"
DataSourceID="SqlDataSource1"
GridLines="Horizontal" CssClass="Grid">
</aspataGrid>
</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.)

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      06-14-2006
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.)

 
Reply With Quote
 
suma suma is offline
Junior Member
Join Date: Jun 2007
Posts: 2
 
      06-01-2007
Hello Steven,
Thank you very much. Your suggestion worked for me Thanks a bunch!!!!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Show border around datagrid row on mouseover? Anthony Jones ASP .Net 0 02-17-2009 01:14 PM
row bottom border in inner table not matching up with row border in outer table phl HTML 1 06-08-2006 03:43 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
Datagrid Border showing when I say no border tshad ASP .Net 0 01-31-2005 05:40 PM
datagrid question border around cells =?Utf-8?B?UGF1bA==?= ASP .Net 4 12-07-2004 03:37 PM



Advertisments