Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DBGrid Controls

Posted on 1998-11-29
10
573 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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