Solved

Color for Data Grid

Posted on 2002-03-25
2
205 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

929 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

14 Experts available now in Live!

Get 1:1 Help Now