Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to change the displayed value in a DBGrid? Posted by softman on 18 Sept 2003 at 10:02 AM
Hi!

I would like to change the displayed value in a DBGrid. The field is a Boolean type, and the default view is true or false. And I would like to change it in the Grid. If the field contains true, display somthing else, like 'payed', and if false, display 'not payed'!

I would appriciate any help!

Thanx
Report
Re: How to change the displayed value in a DBGrid? Posted by polsol on 21 Sept 2003 at 2:18 AM
: Hi!
:
: I would like to change the displayed value in a DBGrid. The field is a Boolean type, and the default view is true or false. And I would like to change it in the Grid. If the field contains true, display somthing else, like 'payed', and if false, display 'not payed'!
:
: I would appriciate any help!
:
: Thanx
:

Easiest way would be to create a string calculated field in the grid and add the code to the grid onCalc event like:

If Grid.field.value := True then Calculated.Field.Value := 'Paid'
else Calculated.field.Value := 'Not Paid'

I've paraphrased this. Assume you can work out the proper code.
Then you can hide the boolean field assuming you don't want to see it.

HTH
Tony


Report
Re: How to change the displayed value in a DBGrid? Posted by softman on 23 Sept 2003 at 7:14 AM
I could not found OnCalc event in the grid, but I found in the TTAble, and there it works fine, as you outlined, so thanx you helped a lot!


: : Hi!
: :
: : I would like to change the displayed value in a DBGrid. The field is a Boolean type, and the default view is true or false. And I would like to change it in the Grid. If the field contains true, display somthing else, like 'payed', and if false, display 'not payed'!
: :
: : I would appriciate any help!
: :
: : Thanx
: :
:
: Easiest way would be to create a string calculated field in the grid and add the code to the grid onCalc event like:
:
: If Grid.field.value := True then Calculated.Field.Value := 'Paid'
: else Calculated.field.Value := 'Not Paid'
:
: I've paraphrased this. Assume you can work out the proper code.
: Then you can hide the boolean field assuming you don't want to see it.
:
: HTH
: Tony
:
:
:

Report
Re: How to change the displayed value in a DBGrid? Posted by polsol on 29 Sept 2003 at 3:09 AM
Whoops, sorry. Should have read my reply more thoroughly. The oncalac is in TTable and not grid.

Tony

: I could not found OnCalc event in the grid, but I found in the TTAble, and there it works fine, as you outlined, so thanx you helped a lot!
:
:
: : : Hi!
: : :
: : : I would like to change the displayed value in a DBGrid. The field is a Boolean type, and the default view is true or false. And I would like to change it in the Grid. If the field contains true, display somthing else, like 'payed', and if false, display 'not payed'!
: : :
: : : I would appriciate any help!
: : :
: : : Thanx
: : :
: :
: : Easiest way would be to create a string calculated field in the grid and add the code to the grid onCalc event like:
: :
: : If Grid.field.value := True then Calculated.Field.Value := 'Paid'
: : else Calculated.field.Value := 'Not Paid'
: :
: : I've paraphrased this. Assume you can work out the proper code.
: : Then you can hide the boolean field assuming you don't want to see it.
: :
: : HTH
: : Tony
: :
: :
: :
:
:

Report
Re: How to change the displayed value in a DBGrid? Posted by polsol on 29 Sept 2003 at 3:13 AM
Whoops, sorry. Should have read my reply more thoroughly. The oncalc is in TTable and not grid.

Tony

: I could not found OnCalc event in the grid, but I found in the TTAble, and there it works fine, as you outlined, so thanx you helped a lot!
:
:
: : : Hi!
: : :
: : : I would like to change the displayed value in a DBGrid. The field is a Boolean type, and the default view is true or false. And I would like to change it in the Grid. If the field contains true, display somthing else, like 'payed', and if false, display 'not payed'!
: : :
: : : I would appriciate any help!
: : :
: : : Thanx
: : :
: :
: : Easiest way would be to create a string calculated field in the grid and add the code to the grid onCalc event like:
: :
: : If Grid.field.value := True then Calculated.Field.Value := 'Paid'
: : else Calculated.field.Value := 'Not Paid'
: :
: : I've paraphrased this. Assume you can work out the proper code.
: : Then you can hide the boolean field assuming you don't want to see it.
: :
: : HTH
: : Tony
: :
: :
: :
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.