Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB-Aware

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2000, 05:56 AM
N/A
Guest
 
Posts: n/a
Default Can you uncheck CheckBox in TwwDBGrid?

Hello!



My problem is that I can't. I can check it, but then I can't uncheck. Is it a bad setting, or something else?



Please help!



Thanks in advance!
Reply With Quote
  #2  
Old 04-15-2000, 06:48 AM
N/A
Guest
 
Posts: n/a
Default RE: Can you uncheck CheckBox in TwwDBGrid?

The values you use must be an either/or setup. Say you use an alpha field, A1, with values Y or N. You can click on the record in question on the column (field) and, on that event, check the field for Y or N. If it is Y, change it to N and vice versa. Did you double click the Grid, highlight the field, and go to the Edit Control tab? Use the drop down on "Control type" and check "Check Box". You can enter the value when it is checked (say Y) and when unchecked (say N). You could also use a button so you could go to a record, click the button and it will change the Checked or Unchecked mode. Here is code.



procedure TForm1.ChangButton(Sender: TObject);

begin

*Table1.Edit;

*if Table1.FieldByName('YorN').asString = 'N' then

* *Table1.FieldByName('YorN').asString := 'Y'

*else

* *Table1.FieldByName('YorN').asString := 'N';

*Table1.Post;

end;



George




Reply With Quote
  #3  
Old 04-16-2000, 11:54 PM
N/A
Guest
 
Posts: n/a
Default RE: RE: Can you uncheck CheckBox in TwwDBGrid?

Hello George!



Thanks your replay! End my problem more precisely: I use Delphi3, InfoPower3 and MS Access97 database. I use boolean field and I double clicked on the grid, highlighted the field, clicked on the EditControl tab, set CheckBox, specified the checked and unchecked values for "true" and "false". And when I use it, I can set the CheckBox state from unchecked to checked, but I can't set the state from checked to unchecked. But if I make another single CheckBox outside the Grid associated with the same database field, it obviously works fine.



If you interested in, I can send an exaple.



Thanks: SAS
Reply With Quote
  #4  
Old 04-18-2000, 10:39 AM
N/A
Guest
 
Posts: n/a
Default RE: RE: RE: Can you uncheck CheckBox in TwwDBGrid?

I went back to my test program and changed the field I used to a Boolean. I was able to change back and forth from checked to unchecked to checked. I use Delphi 5 and InfoPower 2000 but I don't think that should matter. I'd be happy to look at your code. Send it to me.



George
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:22 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.