Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I change the colour of the grid in a GridView.

Reply
Thread Tools

How do I change the colour of the grid in a GridView.

 
 
=?Utf-8?B?RGljaw==?=
Guest
Posts: n/a
 
      01-19-2006
The GridLines property is set to Both and, in any case, I can see them if I
make the background anything other than white. But I really want the
backgroud white! Will I have to be content with not seeing the grid lines? Or
is there a property that I can't see?
 
Reply With Quote
 
 
 
 
Yuan Ren[MSFT]
Guest
Posts: n/a
 
      01-19-2006
Hi,

Thanks for posting!

If you don't want to see the GridLines, why not set the property to "None"?

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGljaw==?=
Guest
Posts: n/a
 
      01-20-2006
I'm sorry but you missunderstand. I DO want to display the GridLines but I
also want the background colour to be white so clearly the GridLines will
have to be another colour - Grey probably - but I can't find a property to
change the GridLineColour! Is there one?

""Yuan Ren[MSFT]"" wrote:

> Hi,
>
> Thanks for posting!
>
> If you don't want to see the GridLines, why not set the property to "None"?
>
> Regards,
>
> Yuan Ren [MSFT]
> Microsoft Online Support
>
>

 
Reply With Quote
 
Christopher Reed
Guest
Posts: n/a
 
      01-21-2006
Using the ItemStyle and HeaderStyle properties, you can set the BorderColor
equal to your color of choice. This will only affect the GridLines and not
the border of the table itself.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Dick" <> wrote in message
news:2E7E88F1-F55F-4170-82B2-...
> I'm sorry but you missunderstand. I DO want to display the GridLines but I
> also want the background colour to be white so clearly the GridLines will
> have to be another colour - Grey probably - but I can't find a property to
> change the GridLineColour! Is there one?
>
> ""Yuan Ren[MSFT]"" wrote:
>
>> Hi,
>>
>> Thanks for posting!
>>
>> If you don't want to see the GridLines, why not set the property to
>> "None"?
>>
>> Regards,
>>
>> Yuan Ren [MSFT]
>> Microsoft Online Support
>>
>>



 
Reply With Quote
 
Yuan Ren[MSFT]
Guest
Posts: n/a
 
      01-23-2006
Hi Richard,

Thanks for your reply!

I'm sorry for misunderstanding the issue. After my researching, if you want
to change the color of the cell border in the GridView control, I suggest
you use the CSS to do. We can use the RowDataBound event to set the color
for the control. Below code demonstrates how to do:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
foreach (TableCell tc in e.Row.Cells)
{
tc.Attributes["style"] = "border-color:red";
}
}

I hope the above information will be helpful. If you have any issues or
concerns, please let me know. It's my pleasure to be of assistance

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

 
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
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Getting default colour for <input> - or just the old colour jodleren Javascript 2 01-12-2008 02:57 PM
Grid edit item : what gives some bound columns a back colour ? Bazza Formez ASP .Net 9 12-09-2004 03:48 AM
Colour blindness, photography and colour management Tor Lillqvist Digital Photography 12 05-24-2004 08:57 AM
Set the background colour of a grid John Doe ASP .Net 7 10-22-2003 01:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57