Solved

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

Posted on 1999-01-18
4
149 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

747 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

10 Experts available now in Live!

Get 1:1 Help Now