Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to change the displayed value in a DBGrid?

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

Comments

  • polsolpolsol Posts: 6Member
    : 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


  • softmansoftman Posts: 157Member
    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
    :
    :
    :

  • polsolpolsol Posts: 6Member
    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
    : :
    : :
    : :
    :
    :

  • polsolpolsol Posts: 6Member
    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
    : :
    : :
    : :
    :
    :

Sign In or Register to comment.