GridView Formatting

S

sck10

Hello,

How do you change the color of the gridlines in the GridView control? I
have tried changing the following, but only the border changes to black, but
the grid lines stay a light gray:

BorderColor="#000000" BorderStyle="Solid"
RowStyle-BorderColor="#000000" RowStyle-BorderStyle="Solid"
GridLines="Both">

Any help would be appreciated.
 
S

Steven Cheng[MSFT]

Hi Sck10,

As for the setting GridLine's color in asp.net2 GridView Control, I think
sck10 is suggestion is exactly the correct means. I've also test on my
side. This works when we set the GridView's GridLine = Both and changing
the BorderColor property will make the gridlines' color also change. You
may have a try to see wheher it works. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

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

sck10

Thanks Steven,

I had already tried what was suggested, but my gridlines are still light
gray. I am using the following, where the border color is set to "Green",
but the grid lines are still light gray.

<asp:GridView ID="gvWebDocList" Runat="server" DataSourceID="dsWebDocList"
AutoGenerateColumns="False" AllowPaging="True" PageSize="40"
BorderColor="#00cc00"
GridLines="Both">
<Columns>
<asp:BoundField HeaderText="Doc Group" DataField="strWebDocGroup" />
<asp:BoundField HeaderText="Doc Type" DataField="strWebDocType" />
<asp:HyperLinkField HeaderText="Title" DataTextField="strWebAddress"
DataNavigateUrlFields="strWebAddress" />
</Columns>
</asp:GridView>
 
S

Steven Cheng[MSFT]

Hi Sck10,

Thanks for your followup. It really seems a bit strange. Here is my test
page 's template
==================================
<asp:gridview id="GridView1" runat="server" datasourceid="SqlDataSource1"
autogeneratecolumns="False" backcolor="White" bordercolor="Yellow" >
<alternatingrowstyle font-italic="False" font-bold="False">
</alternatingrowstyle>
<pagerstyle font-italic="False" font-bold="False">
</pagerstyle>
<columnfields>
<asp:templatefield headertext="OrderID">
<itemtemplate>
<asp:label runat="server" text='<%#
DataBinder.Eval(Container, "DataItem.OrderID") %>'>
</asp:label>
</itemtemplate>
</asp:templatefield>
<asp:boundfield sortexpression="CustomerID"
datafield="CustomerID" headertext="CustomerID">
</asp:boundfield>
<asp:boundfield sortexpression="EmployeeID"
datafield="EmployeeID" headertext="EmployeeID">
</asp:boundfield>
<asp:boundfield sortexpression="OrderDate"
datafield="OrderDate" headertext="OrderDate">
</asp:boundfield>
<asp:boundfield sortexpression="RequiredDate"
datafield="RequiredDate" headertext="RequiredDate">
</asp:boundfield>
<asp:boundfield sortexpression="ShippedDate"
datafield="ShippedDate" headertext="ShippedDate">
</asp:boundfield>
<asp:boundfield sortexpression="ShipVia"
datafield="ShipVia" headertext="ShipVia">
</asp:boundfield>
<asp:boundfield sortexpression="Freight"
datafield="Freight" headertext="Freight">
</asp:boundfield>
<asp:boundfield sortexpression="ShipName"
datafield="ShipName" headertext="ShipName">
</asp:boundfield>
<asp:boundfield sortexpression="ShipAddress"
datafield="ShipAddress" headertext="ShipAddress">
</asp:boundfield>
<asp:boundfield sortexpression="ShipCity"
datafield="ShipCity" headertext="ShipCity">
</asp:boundfield>
<asp:boundfield sortexpression="ShipRegion"
datafield="ShipRegion" headertext="ShipRegion">
</asp:boundfield>
<asp:boundfield sortexpression="ShipPostalCode"
datafield="ShipPostalCode" headertext="ShipPostalCode">
</asp:boundfield>
<asp:boundfield sortexpression="ShipCountry"
datafield="ShipCountry" headertext="ShipCountry">
</asp:boundfield>
</columnfields>
<pagersettings mode="NextPrev">
</pagersettings>
<selectedrowstyle font-italic="False" font-bold="False">
</selectedrowstyle>
<rowstyle font-italic="False" font-bold="False">
</rowstyle>
<headerstyle font-italic="False" font-bold="False">
</headerstyle>
<footerstyle font-italic="False" font-bold="False">
</footerstyle>
</asp:gridview>
===============================

seems haven"t any difference. Have you tried creating a new aspx page or
even a new project on some other machines to see whether the problem still
remain? Currently I also haven't any good idea on this.

In addition, I think you can also have a look in the Whidbey beat
newsgroup to see whether there're any clues:
Microsoft Visual Studio 2005 Newsgroups
http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&slcid=us

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

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

Steven Cheng[MSFT]

Hi Sck10,

Have you got any further progresses on this issue? If there're anything
else we can help, please feel free to post here.Thanks.

Regards,

Steven Cheng
Microsoft Online Support

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top