Hello all.
I shall attempt to explain the scenario.
I have a gridview I wish to amend according to the preferences a user may set. These preferences being stored within a table in a EDMX (tblPref). The table gives the prefernce i.e. Product, the Alias for the preference i.e. SKU and whether the Preference should be shown i.e. ShowProduct?
So for example, the 'standard grid' would look like this:
Product UUF1 UUF2
1 a d
2 b e
3 c f
tblPreference would look like the following:
Preference Alias ShowPreference
Product Product 1
UUF1 UUF1 1
UUF2 UUF2 1
However, it may be the case that user may wish to see different columns i.e.
Product UUF2
1 d
2 e
3 f
tblPreference would look like the following:
Preference Alias ShowPreference
Product Product 1
UUF1 UUF1 0
UUF2 UUF2 1
And/Or they wish to label the headers with different text i.e.
SKU Category Sub-Category
1 a d
2 b e
3 c f
tblPreference would look like the following:
Preference Alias ShowPreference
Product SKU 1
UUF1 Category 1
UUF2 Sub-Category 1
Now then, I realise that it is possible to hide columns (gridview.columns[0].Visbile = False) and that I can amend header text (gridview.HeaderRow.Cells[0].Text = "Sku").
What I am unsure is how I bring it altogether...the important part!
Obviously a fair few 'ifs' will be involved but I was wondering if anyone had done anything like this before and could provide a bit of pseudo code?
The reason I am going down this route is that I may have several hundred users who could potentially want the gridview to look completely different to them. Being a newbie, it is also good for me to try more difficult things rahter than 'dragging and dropping'.
Therefore any help provided will be gratefully received.