Board index » delphi » DBGrid --- D1

DBGrid --- D1

Hello People !

I have some trouble on making a DBgrid to work proberly. I have to
columns containing
the brand and model of a car...

Car                    Model
Audi                    100
Audi                    100
Audi                     80
Bmw                    320
Bmw                    320
Bmw                    320

I want to make a function which makes repeatet data invisible like this:

Car                    Model
Audi                    100
-                           -
-                           -
Audi                    80
Bmw                   320
-                         -
-                         -

But my problem is, how the 'OndrawDataCell' function works. It is no
problem to make all lines of one kind of  'Car' invisible, but to show
the first instance and make the following repeats invisible is a bigger
problem ?

Any solution/hint is very velcome !

Frank Dossing

 

Re:DBGrid --- D1


On Tue, 02 Sep 1997 09:07:44 +0200, Frank Dossing

Quote
<ccc12...@vip.{*word*104}city.dk> wrote:
>But my problem is, how the 'OndrawDataCell' function works. It is no
>problem to make all lines of one kind of  'Car' invisible, but to show
>the first instance and make the following repeats invisible is a bigger
>problem ?

Instead of going through the pains of writing all that code, why not
use a unique index on the data to do the work for you?

Depending on what database you use this can be very easy (if it's SQL,
just use select distinct)

Julian van Tubbergh.

Other Threads