No announcement yet.

Dynamic columns in grid application

  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic columns in grid application

    Hello guys,

    I am trying to build grid application based on a dynamic structure generated by another query. Let me show you.

    1. I have an evaluation format that has a min and max value, for example:

    select min(required), max(required) from evaluation where day = today

    Everyday these values changes, for example, today could be [1, 5]; tomorrow could be [2, 7]

    2. I need yo build a grid where I need to show the grades based in the evaluation format. For example, for today [1, 5] the grid should be displayed like:

    // this query will return: frank, 4
    select name, grade from grades where student = x;

    Name | 1 | 2 | 3 | 4 | 5
    Frank |....|....|....| x |....

    What does happen in the next day for evaluation format [2, 7] with the same student? This:

    Name | 2 | 3 | 4 | 5 | 6 | 7
    Frank |....|....| x |....|....|....

    My problem resides in how I build the grid's columns based in the result of another query. The rest is another story. Anyone has an idea? I have a "my last card" idea using an UNION statement. but may you have a coolest idea. Thank you in advance.

  • #2
    You cannot have grid with dynamic columns. The only solution - and I don't know if that fits your need - is to create a full grid with all columns and hide columns depeding on the situation. The point is that SC is depending on the data structure. The query is fixed and used to generate the column headers.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      I ended doing this manually querying the data in an event and building a table there. Thank you so much.


      • #4
        Hi Manfred, Care to share exactly how you did this ? I posted a question about this after replying to this post and it was deleted. It is a limitation of SC 8 that you cannot have dynamic forms or grids, you have to go back to the grid or form application and either edit the sql (Grid) or synchronize(form). This means that any requirement to add columns dynamically eg user has the ability to add fields, is not catered for natively.
        Last edited by leonvz; 03-02-2017, 08:21 AM.