How to change the displayed value in a DBGrid? - Programmers Heaven

Howdy, Stranger!

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

Categories

How to change the displayed value in a DBGrid?

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