Solved

Checkbox in dbgrid

Posted on 1997-11-11
1
718 Views
Last Modified: 2008-03-10
How can I get a logical field to show up as a checkbox in a dbgrid?
0
Comment
Question by:lizzzard
1 Comment
 
LVL 1

Accepted Solution

by:
sassas081597 earned 50 total points
ID: 1350017
I give you an idea only. Set DefaultDrawing property of DBGrid to false.
Write the following procedure (I do not draw the checkbox, I only change the color of the cell. The canvas is in your hands. Draw all that you want).

procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
  Field: TField; State: TGridDrawState);
begin
     If Field.AsBoolean then
     DBGrid1.Canvas.Brush.Color:=clGreen
     else
     DBGrid1.Canvas.Brush.Color:=clRed;
     DBGrid1.Canvas.FillRect(Rect);
end;
At least write the OnClickMethod for these columnes to exchange True and False;
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

9 Experts available now in Live!

Get 1:1 Help Now