473,398 Members | 2,403 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,398 software developers and data experts.

Datagridview Conditional Formatting in .Net 2005

Hi all,

I am using a datagridview in .Net 2005 to display data from a stored
procedure using a System.Data.SQLClient connection. After the stored
procedure dumps the data into a dataset and the datagridview is displayed I
need to conditionally format the backcolors of the rows (this will be
controlled by the value of a cell that contains a checkbox from the SQL
table). How do I change the row backcolor if the cell's check box is checked
on any given row (and there are many rows) - the row backcolor needs to be
changed to red, otherwise the row backcolor should be displayed as white.

I have tried several different pieces of code without any luck. Any help
would be appreciated. Thanks!
Mar 16 '06 #1
1 11295
jbehrne wrote:
Hi all,

I am using a datagridview in .Net 2005 to display data from a stored
procedure using a System.Data.SQLClient connection. After the stored
procedure dumps the data into a dataset and the datagridview is displayed I
need to conditionally format the backcolors of the rows (this will be
controlled by the value of a cell that contains a checkbox from the SQL
table). How do I change the row backcolor if the cell's check box is checked
on any given row (and there are many rows) - the row backcolor needs to be
changed to red, otherwise the row backcolor should be displayed as white.

I have tried several different pieces of code without any luck. Any help
would be appreciated. Thanks!

http://msdn2.microsoft.com/en-us/library/z1cc356h.aspx

This should give you the information you are looking for.

Chris
Mar 16 '06 #2

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

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
8
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format...
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
3
by: DS | last post by:
I have a Field that reads #Error, sometimes...I want to use conditional formatting to hide the field when it reads #Error...so in conditional formatting I put - when field equals "#Error" , but it...
2
by: ScottL | last post by:
Hi - I have an issue with the DataGridView. I am formatting the DGV in code and not using the designer. I drop a DGV on my form, code the formatting including some columns.visible = false. After...
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
2
by: Filips Benoit | last post by:
Dear All, Access 2003 adp on SQL_server 2005 A continious form showing 1 month based on table 'CALENDAR_MONTH_GRID' and fill with a SP. Fields: Companyname, Day1, day2, etc. The value in the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.