Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 26 Sep 2020, 23:48

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: ALLOWGRAYED
PostPosted: 25 Oct 2017, 10:03 
Offline

Joined: 26 Feb 2012, 11:20
Posts: 5
Hello,
I have an application where the null values in the dbcheckboxeh must be true or false.
The customer doesn't want to see grayed checkboxes nor in dbgrideh and not in dbcheckboxeh ?
I set the allowgrayed value to true but if the value is null in the field - the checkboxes are still grayed.
Is there a way to do that?
Regards.

Remy

------------
Actually I have done the requirement of the customer by modification in the source code. I'm looking for something better and smarter :)

function TCustomDBCheckBoxEh.GetFieldState: TCheckBoxState;
var
Text: string;
begin
if FDatalink.DataIndepended then
begin
Result := cbGrayed;
if VarEquals(FDatalink.DataIndependentValue, True) then
Result := cbChecked
else if VarEquals(FDatalink.DataIndependentValue, False) then
Result := cbUnchecked;
end else if FDatalink.Field <> nil then
if (FDataLink.Field.DataType = ftBoolean) and
(FValueCheck = STextTrue) and
(FValueUncheck = STextFalse) then
begin
if FDataLink.Field.IsNull then
Result := cbUnchecked {REMY cbGrayed}
else if FDataLink.Field.AsBoolean then
Result := cbChecked
else
Result := cbUnchecked
end else
begin
Result := cbGrayed;
Text := FDataLink.Field.Text;
if ValueMatch(FValueCheck, Text) then Result := cbChecked else
if ValueMatch(FValueUncheck, Text) then Result := cbUnchecked;
end
else
Result := cbUnchecked;
end;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group