ASP.NET - Building and Binding dynamic data to Grids

Asked By Anup Kumar on 13-Aug-14 08:27 AM
    • We use Grids extensively in our application.

      All the important modules has a list page where data is bound using objects LIST<obj> to the grid and this is working fine.

      Now there is a change in the requirement and based on that the data bound to the grid will be dynamic. 

      Currently the List<obj> that is bound is created using stored procedures and filling out the static object created for the display. 
    • But now the user is given options to add as many fields as he requires in the form which should also be bound to the grid. 
    • So the current implementation (LIST<obj>) will not work because the properties in the object will change based on the no of fields 
    • the user adds. The stored procedure will return different sets of columns based on the fields that the user has added. 
    • Using this object currently we also have implemented custom sorting, filtering, paging and grouping.

      With the new requirement in mind, what will be the best implementation?  (Binding Datatables directly,  or create objects dynamically). 
       
    •      
Robbe Morris replied to Anup Kumar on 13-Aug-14 08:29 AM
Create the grid dynamically.  Largely because the user's requirements are dynamic and you'll beat your head against the wall each time you think you've got all of their variances and user interface nuances nailed down, they'll through a different requirement at you.