I need to build a form that shows data is the following format:
M(1 Nov), T(4 Nov), S(7 Nov) etc
user 1 yes/no yes/no yes/no yes/no
user 2 yes/no yes/no yes/no yes/no
The yes/no will be represented by a check box and there will be Monday, Thursday and Sunday columns for each occurrence within the month – dynamically worked out. I was planning on using Anonymous Type’s as explained here to represent the data. Is this a sound approach? My problem is how to display this using a GridView or DataList control. If the data structure is dynamic, how can I configure the GridView/DataList control to bind to the data?
Is there a better approach to what I’m trying?
Use a DataTable stored in the ViewState to carry the data and bind to a GridView / DataList.
When the user makes changes, it should persist to the DataTable structure. Once the changes are complete and successfully validated, you can simply foreach (DataRow in MyDynamicDataTable) to process the selections that the user made and persist them to database, or whatever.