I am trying to generate a table which would show all possible combinations based on the key. To make it more clear lets say I have a kind of Key, Value pair set(Its mentioned kind of because there are unique keys and different values). I need to fill the table with all possible combinations of the values with different keys.
Now i need to make the key as the heading of the table and add the values accordingly so that there are no duplicate rows and all combinations are present. I am doing it in C#. I could only retrieve these key value pairs from my database based on conditions, but I have no idea how the table can be built.
Are there any examples someone could provide? Or a basic approach I should follow to achieve it?
So far my ideas:
To create an array with size equals number of distinct parameters of key. Add values to the array and then pass a list of the Array to the View.
P.S : My data model is complex. Reference to this question would give an idea of a part of my Data model. The value I am talking about comes from the SetValue described in the model and the key from another class which is not described (I feel this information is irrelevant as I have already the list of my Key value pairs). I think I have posted the question in the right forum, as I am not asking for any code. If not please let me know the right forum where this question will belong to.