473,799 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why not color?

I'm writing a program in VB .NET 2k3, I have a datagrid bound to a database
(Access 2002). Does anyone have info or know where I can go to change the
color of a row based on the value in one column? I have found stuff on
alternating colors and all that good stuff but nothing that I need. Thanks
Nov 21 '05 #1
3 1092
Hi Brix,
Have a look at: http://64.78.52.104/FAQ/WinForms/default.asp
under the datagrid section.

Item 5.14 might be helpful

Doug

"brix_zx2" <br*****@discus sions.microsoft .com> wrote in message
news:D0******** *************** ***********@mic rosoft.com...
I'm writing a program in VB .NET 2k3, I have a datagrid bound to a database (Access 2002). Does anyone have info or know where I can go to change the
color of a row based on the value in one column? I have found stuff on
alternating colors and all that good stuff but nothing that I need.

Thanks
Nov 21 '05 #2
It'd be nice to have conditional formatting as found in Access, wouldn't
it? :) Thankfully there's another way.

You can attach a handler to the ItemDataBound event of the DataGrid
class. This event is fired once for each row in your datagrid. Check the
appropriate field, and if it matches your requirements, colour the
entire row.

---
Private Sub OnItemDataBound (Sender as Object, E as
DataGridItemEve ntArgs) Handles DataGrid1.ItemD ataBound
If CType(e.Item.Da taItem, DataRowView)("Y ourColumn") = 3 Then
E.Item.BackColo r = KnownColor.Alic eBlue
End IF
End Sub
---

Hope that helps you.
Regards,
-Adam.

brix_zx2 wrote:
I'm writing a program in VB .NET 2k3, I have a datagrid bound to a database
(Access 2002). Does anyone have info or know where I can go to change the
color of a row based on the value in one column? I have found stuff on
alternating colors and all that good stuff but nothing that I need. Thanks

Nov 21 '05 #3
"brix_zx2" <br*****@discus sions.microsoft .com> schrieb:
I'm writing a program in VB .NET 2k3, I have a datagrid bound to a
database
(Access 2002). Does anyone have info or know where I can go to change the
color of a row based on the value in one column?


(Syncfusion links may be slow...)

5.14 How do I color a individual cell depending upon its value or some
external method?
<URL:http://www.syncfusion. com/FAQ/WinForms/FAQ_c44c.asp#q7 45q>

5.67 How can I change the font used in a grid cell on a cell by cell or row
by row basis?
<URL:http://www.syncfusion. com/FAQ/WinForms/FAQ_c44c.asp#q9 27q>

Changing the background color of cells in a DataGrid
<URL:http://www.codeproject .com/csharp/custom_datagrid columnstyl.asp>

<URL:http://www.google.de/groups?selm=avm 8j6%24guusa%241 %40ID-117757.news.dfn cis.de>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

4
5371
by: dan glenn | last post by:
(PHP4.3.4, GD2) How can I save a PNG using GD2 and insure that it saves as a palette-based (8-bit, 256-color) single-color transparancy?? Saving this way, I could be sure that an image loaded from a transparent gif could be saved as a png and the png would work in IE versions 5.5 and greater (IE has bug that messes up png transparancies which use full alpha channel). thanks for any help at all, -dg
6
4146
by: me | last post by:
good day, i found this message: and i want to know more about it too. ========================================== Hey all, example: $s_Colors="0066FF;0066CC;3366CC;0033FF;003399;003366;99CCFF;3399FF;0099FF;66
6
8510
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black (which is not, in this case). I can't find any documented way to change the default fill color (if that's what it is) for the corners, and PIL also doesn't seem to support a flood fill. I have created a flood fill in Python, which works but which...
3
5076
by: Richard A. DeVenezia | last post by:
I hope this is the end of my present 'discovery' phase. I've learned alot about JavaScript in a short time and my head hurts. The following is what came out of all my questions and all the excellent answers (thanks!). It will be the basis of a slightly more complicated function for rendering a two-level navigation bar ( Don't have time to get into design of a multi-styletype renderer for n-level hierarchies. ) This is a single function...
5
3489
by: Chris Beall | last post by:
I'm displaying an image that is also a link against a black background. In Netscape 7.1, the current background color is displayed as a horizontal bar below the image. This allows :hover effects that change the background color to have a visible effect, as this bar changes color. By default, it appears that the color is inherited from the body color, i.e. with no link style applied, the bar is black, and invisible against the background....
4
19900
by: bart plessers | last post by:
Hello, I am making a website where the user can choose a 'skin'. This works with asp en stylesheets. In the stylesheet, a number of tags are (re)defined. The main idea is to have a limited number of colors (lets say 4) and use only these colors to color up every tag. However, with a long list of (custom) styles, it is a lot of work to scan
18
10748
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand where they have been. I also agree to the background: Too many web authors keep uniform link colors or their pages, thereby confusing the users. What I have a hard time agreeing to is his conclusion that web authors should deliberately change the...
25
12945
by: Neal | last post by:
According to the CSS lint at http://htmlhelp.org/tools/csscheck/, "The shorthand background property is more widely supported than background-color." Can anyone point me to, or provide, information on what browsers have difficulty with the non-shortcut methods of setting background properties?
27
13585
by: Kevin Yu | last post by:
When I declare on HTML page <LINK href="mycss.css" type="text/css" rel=stylesheet /> .... <BODY class=myclass> in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); }
7
3358
by: Jonathan N. Little | last post by:
When doing a final check on my stylesheets the CSS Validator flag lines like this one as an error: ADDRESS A { color: gold; } Error is: # Line: 31 Context : ADDRESS A Invalid number : colorgold is not a color value : gold Strangely if I change the style sheet to:
0
10491
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
10268
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
10247
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
10031
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
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.