Solved

DBGrid Controls

Posted on 1998-11-29
10
570 Views
Last Modified: 2010-04-04
Does anyone know where I can find data-aware DBGrid controls that have the facility to show a check box for boolean fields like (dare I say it) MSAccess. I've found XDBGrid from Torry's but it does'nt support the combo-box functionality for lookup fields which is a definite requirement also.

Either that, or could someone give me some pointers on how to make a new component that's descended from TDBGrid that will have the check box display?

Cheers
Darren
0
Comment
Question by:elkiors
  • 5
  • 5
10 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 30 total points
ID: 1348488
Hi elkiors,

I once made such a one together with Inter (he did most of it)

Give your e-mail and I'll send it to you.

Zif.
0
 

Author Comment

by:elkiors
ID: 1348489
Hi zif,

darren.elkiors@mcmail.com

any chance of the source aswell??

Darren

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348490
Offcourse you get the source! It's not much dough. It just gives checkboxes (or radioboxes) instead of true and false. So it's very easy to understand.
We once wanted to enhance the grid. But we never came to it. Maybe you some nice ideas?

ps. Do you know by any change of a dbgrid which can swap its rows with the columns and vicaversa?

Mail is comming. Enjoy!
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:elkiors
ID: 1348491
Hi, Zif

It works great, just what I was after. The CheckBox click is a bit fiddily, I had to put a AField.Value:=NOT AField.Value in the OnCheckClick event, maybe I'll tweak the component code a little ...

I've spotted your problem of grid row/column swap in the earlier questions. Sorry, can't help you much there, i'll have a think about it.

If I see any interesting grid components around I'll let you know.

Thanx

Darren.

0
 

Author Comment

by:elkiors
ID: 1348492
Zif, are you still there. DBCheckGrid is causing problems.

I'm getting a List Out Of Bounds exception if I click anywhere other than a cell or title, that is, the background of a part filled grid.

What do I need to do to fix it. I have a feeling it may have to do with the fact that the datasource is the detail side of a relationship, maybe your component isn't counting the records properly or something ???

Help

Darren

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348493
Hi Darren,

sorry wasn't online anymore. This is a solution :

if not FCheckActive then // no need to custom handling if no checkbox visible
   if C.X <> -1 then {SOLUTION}
    if (FFixedList.Items[C.X-Ord(dgTitles in Options)] = Pointer(1)) or
       FFixedEnable then
    inherited MouseDown(Button, Shift, X, Y);

This error appeared after we added the option to add fixed columns

Regards, Zif.
0
 

Author Comment

by:elkiors
ID: 1348494
Zif:

Sorry to trouble you again, but the solution only fixes a click on the grid background, I'm still getting list out of bounds -1 if you ckick on the record indicator column (if you turn showindicator off the error comes up on the first field ie the error always is shown for column 0. I verified this by trapping values for C.X and C.Y and it just doesn't like C.X=0 ie column 0.

Maybe it has something to do with the GetFixed procedure as this compiles showing warnings that result may not be defined (because it's value is set explicitly in an if..then) having said that though, I have a feeling that this procedure is never executed.

Any thoughts?

Maybe Inter has some thoughts too, if he had a lot to do with the component design.

I've got some points spare again if you want me to post as a proper question rather than an adendum to this thread.

Cheers

Darren

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348495
Hi Darren,

Sorry, my mistake again (these days, grumble ...), it has to be :

 if not FCheckActive then // no need to custom handling if no checkbox visible
   if C.X > 0 then
    if (FFixedList.Items[C.X-Ord(dgTitles in Options)] = Pointer(1)) or
       FFixedEnable then
    inherited MouseDown(Button, Shift, X, Y);

It's because if we click on the indicator column we get c.x=0, but we extract this with 1 (in this case) so we end up with -1. then we try to look in our list with fixed columns (=tlist). But -1 does't exist! It starts from 0. -->>> wam, we get an error!

Now it should work!

Regards, Zif.
0
 

Author Comment

by:elkiors
ID: 1348496
Zif:

Works like a treat now! Maybe you're spreading your self a little thin. I suppose it must be tough at the top.

Anyway that's it, I'll leave you alone now so you can pick up the broken pieces of other hapless amateurs like me.

I'll keep looking for any interesting grid controls for you.

Anyway, Chin up, if you didn't make the odd error now and again you would'nt be human and we'd have to start leaving sacrifices to the altar of ZifNab The Great!

See ya

Darren
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348497
:-) See ya Darren.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 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