Solved

DBGrid Controls

Posted on 1998-11-29
10
553 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
 

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

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 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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

18 Experts available now in Live!

Get 1:1 Help Now