473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

VB.net Datagridview cellstyle colors

Hi All

I am using VB.net 2005 professional

I set the background color of a datagridview cell to different colors
depending on many reasons

I set them in the cellformatting event and all works great, i.e the colors
appear as requested
e.g e.CellStyle.BackColor = Color.Red

When I try to read the color in Datagridview.mouseclick event using...
If
dgvgroup.Rows(hit.RowIndex).Cells(hit.ColumnIndex) .InheritedStyle.BackColor
= mycolor Then

it always returns false

end if

Note: mycolor = color.salmonpink and actual grid cell color =
color.salmonpink

but
dgvgroup.Rows(hit.RowIndex).Cells(hit.ColumnIndex) .InheritedStyle.BackColor
returns color.honeydew which is the defaultcellstyle.backcolor set in

datagridview properties defaultcellstyle in design environment

what am I doing wrong

Regards

Steve

Sep 11 '07 #1
1 7092
Hi Steve,

How about the problem now?

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Sevice!

Sincerely,
Linda Liu
Microsoft Online Community Support

Sep 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: rob | last post by:
I have a class that among others exposes a string property "Date". The date in this property is stored in the form yyyymmdd. Now I do the following 1) Generate a DataGridViewTextBoxColumn column...
0
by: sunny076 | last post by:
Hi, I am having difficulties creating a derived class for DisabledDataGridViewTextBoxColumn and cell when the VisualStyle is not supported. Basically I am down to either using ControlPaint or...
3
by: Rich | last post by:
Hello, If I want to update data displayed in a datagrideview/datagridview cell, how can I determine what cell I am updating? I am looking at the click event below, for example. Can I get...
2
by: =?Utf-8?B?VG9jbw==?= | last post by:
Hello. My goal is to pain the entire row fore color as Red. If the value of column 24 is true (boolean), I wish to paint the row as Red. Otherwise, leave row as default (no formatting). The...
0
by: Steve | last post by:
Hi All I am using VB.net 2005 professional I set the background color of a datagridview cell to different colors depending on many reasons I set them in the cellformatting event and all...
0
by: NvrBst | last post by:
How does "e.CellStyle" work? When I do something like if(e.ColumnIndex == 0 && e.RowIndex == 0) DataGridView.Rows.DefaultCellStyle.BackColor = Color.Orange; then the entire table goes orange;...
18
by: Andrus | last post by:
Marc, Thank you very much. I have issue on implementing add row properly using this. User presses down arrow in last row in grid starting adding new row. Then user changes its mind desiding...
0
by: ziketo | last post by:
Hi, I searched a lot about changing the DataGridView cell borders. BYTES helped me so I will write down the solution: 1. You should override the class DataGridViewTextBoxCell, and the new class...
3
by: KrishnaSarala | last post by:
Hi All IT developer and C# expert please help me urgent. I'm working on a project of Bakery Management. I'hd shown the room booked in hotel in Datagridveiw Control. My client require the cell color...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.