Solved

Color for Data Grid

Posted on 2002-03-25
2
204 Views
Last Modified: 2010-05-02
Dear Experts,

I need to make some rows within the data grid to appear in other color if the particular record meets my criterias. I couldn't find a way to make a particular row to appear in color, but only the entire grid.

Thanks for any answer given.
0
Comment
Question by:MaxLen
2 Comments
 
LVL 6

Expert Comment

by:xSinbad
ID: 6895691
I dont think you can do that with a data grid but if you use a flex grid you can.

Below is a simple example of how to do this with a flex grid;

Private Sub Form_Load()
Dim i
For i = 1 To 10
MSFlexGrid1.AddItem "Test" & i, i
 If i = 5 Then
    MSFlexGrid1.Row = i
    MSFlexGrid1.CellBackColor = vbBlue
End If
Next i
End Sub


Cheers
Marcus
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 6895893
xSinbad is exactly right, you cannot do this with the standard datagrid, you either have to use the standard flexgrid control that ships with VB but this does not have the ability to enter data directly into cells, nor does it happily handle data-binding with ADO recordsets. Or you can buy a control which does it all such as the TrueDBGrid or VSFlexgrid from http://www.componentone.com
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now