473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagridview background color ???

Dear all,

I have a datagridview whcih is bind to a database.
I would like that the row backround color is red for all records where the
content of the column x is 2.

What is the way to do that ?

thnaks for help
regards
serge
Oct 1 '07 #1
0 1444

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

Similar topics

1
1798
by: Bob | last post by:
I have a form with one control a datagrid view that is bound to a table an OK button and a close button - No navigation controls. Its just used a a selector for a record and then opens another form, storing the primary key of the chosen record in a global variable for later use when the user clicks on OK. Problem is, I display two columns in the grid and when the form opens, the first cell in the first row always has a blue background,...
11
109603
by: dgk | last post by:
Is there a way to change the foreground or background color of a single cell in an unbound datagridview?
0
2492
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 Graphics to achieve this. But with Graphics, I am not sure how I can make them diabled. Below are my codes:
6
24775
by: martin1 | last post by:
Hi, all, Is there any way to change DataGridView row color based on different row data? for example, if row data in first column = 1, it is yellow, if it is 2, it is blue, if 3 it is white. That means how to loop DataGridData to get row data, then based on the different data to change row background color? Thanks in advance!
7
12624
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's the background for my question... Before I switched my application over to the Fx 2.0, I used a DataGrid to display my data. I would store different DataGridTableStyles (each one with a custom set of columns) in the DataGrid.TableStyles property...
7
10068
by: John J. Hughes II | last post by:
I have a DataGridView with a TextBoxColumn. I setting the data source to a List<stringvalue in a static class. The list is filled from a background thread. So far all is fine and it works great, at least on my system. The reason I am doing this is some customers are pulling from VPN connections which are slow. This allows the list of rows in the data grid to appear a little quicker while the list which are not used as soon load in...
1
13650
by: Diogo Alves - Software Developer | last post by:
Greetings, I've been trying to put an image on the background of a datagrid, I used the overriten property BackgroundImage, but it was useless (maybe I'm missing something). Could someone help me with this... I want to put a gradient on the background of the datagrid... but can't find any way to do this....
1
1388
by: Jeff | last post by:
..NET 2.0 On my form I have a DataGridView, I want the rows in this DataGridView to have different background colors. The data presented on the rows are of 3 types: A, B or C.... For the user to easy see what type the data on each row have I want to individually set the background color of each row... For example rows with data of type A gets a light-blue background color, B gets light green and C get a light red color... Is this...
0
1584
by: Przemek | last post by:
Hello, I have a little problem. I use flat style for Buttons on DataGridView and every looks fine (non 3d buttons) but when I move mouse over DataGridView Button then background of this button are darker and when I down left button of my mouse over this DataGridView Button then background of this button are lighter. I want to see one color (ex. "Control") when I move over, click or leave this button but I don't know how to do this.
4
5583
by: Peted | last post by:
Hi I need to iterate through a winforms visible datagrid, in a legacy application, to update it a little bit to change the background colours of the grid. This seems to be more dificult than i expected as it does not appear the DataGridRows collection is exposed with DataGrid. Is there a way to/ or best way to iterate through the rows of a
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9174
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9111
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8096
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.