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.)