Solved

how can i assign a color to an row in an Dbgrid?

Posted on 1999-01-18
4
150 Views
Last Modified: 2010-04-04
how can i assign a color to an row in an Dbgrid?

i have a Table with these fields:

key    n  *
Name   n
adress n
Color  n
 
then i have a Form, Dbgrid Datasource, Ttable

when i capture the color in an appendrecord:

table1.appendrecord([
                     key.text,
                     name.text,
                     adress.text,
                     panel1.color
                    ])

then i have an Dbgrid with tree fields(Key, NAme and adress), but i need assign the color (of the field Color) in  the field respectively
0
Comment
Question by:jamiguel
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 0 total points
ID: 1362351
Write a handler for the grid OnDrawCell event which sets the color of the canvas for the grid to the appropriate colour.

Cheers,

Raymond.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1362352
And if you need an example of how to accomplish that I have some the original was not written by me, but I have used it in a stringgrid.

:O)
brUINTje.
0
 

Author Comment

by:jamiguel
ID: 1362353
<Rwilson>
Your answer is good, but alone it is an idea, of all ways served me

<Bruintje>
can you send me the example to jamiguel@mail.itcac.mx ?


0
 
LVL 44

Expert Comment

by:bruintje
ID: 1362354
"And together will we build a nicer world" :O))))))))))

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 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

15 Experts available now in Live!

Get 1:1 Help Now