Here Mudassar Ahmed Khan has explained with an example, how to bind (populate) WebGrid using dynamic DataTable (DataSet) in ASP.Net MVC Razor.
Inside the Controller, first a DataTable object is created with some dynamic Columns and then records are added to the DataTable.
Finally the DataTable is added to a DataSet which is later used to populate the WebGrid in ASP.Net MVC Razor.
↧