locked
Grid formatting RRS feed

  • Question

  • I want to display a grid which will have total rows listed in the grid. Like group bands in reports.

    So for example the grid will display colums for Prod_ID, Prod_group, qtty, price

    But when product group is changed, I want to add a row "Total items for group xxx: nnn"

    Is there a way to do this while keeping the original column structure?

    Thanks.


    • Edited by Aleniko2 Friday, January 11, 2019 2:23 AM
    Friday, January 11, 2019 2:22 AM

Answers

  • Hi Aleniko2,

    where do you want to place the new row? Right below the current row or below the grid?

    Below the grid would need a summary grid to be placed below the entry grid and could show different values for the complete grid. This can easily be done by calling a routine thats bound to  'afterrowcolchange'.

    Displaying an additional row inside the entry grid is also possible, but a bit more complex.

    Usually you have the option to work with currentcontrols in each column. I'd add an invisible column (i.e. controlID) to your datacursor that defines which currentcontrol (defaultvalue = 1) has to be used (and for identifying the type of row by defining a color array offset that specifies the row backcolors).

    This additional column has to be part of the grid sorting. Sort #1 would be more or less the rowid (NOT UNIQUE) and the new row attached to the special rowid get an identical rowid but controlID value = 2

    JM2C


    Gruss / Best regards
    -Tom
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible,
    you are, by definition, not smart enough to debug it. 010101100100011001010000011110000101001001101111011000110110101101110011

    • Marked as answer by Aleniko2 Tuesday, January 15, 2019 9:38 PM
    Saturday, January 12, 2019 1:44 PM
    Answerer

All replies

  • Hi Aleniko2,

    where do you want to place the new row? Right below the current row or below the grid?

    Below the grid would need a summary grid to be placed below the entry grid and could show different values for the complete grid. This can easily be done by calling a routine thats bound to  'afterrowcolchange'.

    Displaying an additional row inside the entry grid is also possible, but a bit more complex.

    Usually you have the option to work with currentcontrols in each column. I'd add an invisible column (i.e. controlID) to your datacursor that defines which currentcontrol (defaultvalue = 1) has to be used (and for identifying the type of row by defining a color array offset that specifies the row backcolors).

    This additional column has to be part of the grid sorting. Sort #1 would be more or less the rowid (NOT UNIQUE) and the new row attached to the special rowid get an identical rowid but controlID value = 2

    JM2C


    Gruss / Best regards
    -Tom
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible,
    you are, by definition, not smart enough to debug it. 010101100100011001010000011110000101001001101111011000110110101101110011

    • Marked as answer by Aleniko2 Tuesday, January 15, 2019 9:38 PM
    Saturday, January 12, 2019 1:44 PM
    Answerer
  • Usually you have the option to work with currentcontrols in each column
    Wednesday, January 16, 2019 1:59 PM