Solved

DBGrid Controls

Posted on 1998-11-29
10
587 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 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