Solved

DBGrid Controls

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

 
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

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

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…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

23 Experts available now in Live!

Get 1:1 Help Now