PC Review


Reply
Thread Tools Rate Thread

DataGridView e.CellStyle.BackColor not working

 
 
Backwater Geezer
Guest
Posts: n/a
 
      9th Oct 2008
Hi there,

Strange problem

I tried to change the back color to red.

e.CellStyle.BackColor = Color.Red;


First I put the code into CellFormatting - nothing happened.
CellPainting - the same, I mean nothing.

Going through debugger the code is being executed but the screen shows
the default color.

Just in case I deleted the grid and put it again from scratch. Did not
help. The grid is a part of a UserControl and is not public so nothing
from 'outside' can mess it up.

On other hand the above code works fine in a different application.

Any ideas?

MH
 
Reply With Quote
 
 
 
 
Backwater Geezer
Guest
Posts: n/a
 
      9th Oct 2008
OK, forget.
I tested on a single line grid where the selection was set to row.

MH
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Change color of DataGridView row (BackColor) Lloyd Sheen Microsoft VB .NET 1 2nd Jan 2009 04:40 PM
VB.net Datagridview cellstyle colors Steve Microsoft VB .NET 2 14th Sep 2007 02:32 PM
Datagridview cellstyle Steve Microsoft VB .NET 0 5th Sep 2007 09:46 AM
How Do I Change the BackColor for DataGridView Cells? TC Microsoft VB .NET 2 11th Jul 2007 04:52 PM
c# 2.0 Datagridview columnheader backcolor forecolor =?Utf-8?B?R29yZG9uIE1vb3Jl?= Microsoft Dot NET Framework 4 19th Sep 2005 01:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:47 AM.