WebGrid Batch Update

11 replies. Last post: November 6, 2009 10:29 AM by Adrian Cunningham
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Hi,

Questions:
  1. Will the BatchUpdate feature of the WebGrid Update a DataTable constructed in the Code Behind of the ASPX page that is not connected in any way to the physical database?
  2. If so at which point is the DataTable updated as I can't see the changes in the BatchUpdate method? And will need to iterate through the DataTable to actually write the changes to the database.
Context:
DataTable is used to flatten out a complex data structure so each value can be display on a row.

Top level Data Object (Region Object) contains a nested List of data, each element is a Data Object (Factor Object)

Each element (Factor Object) of the nested list also contains a nested list of data, each elemtn is a data object (LOBFactor object).

Each element (LOBFactor Object) of nested list contains a list of data objects (FactorValue Object) which contains the actual data values.

Here is data structure:

Factor Object
...
private int _factorID
private string _Description
private int _months;
private decimal _rate;
private List<LOBFactor> _lobFactors // Contains a list of 7 objects.
...


LOBFactor Data Object: (7 instances of this object, i.e. 7 ColumnSets)

LOBFactor Object
...
private int _lobID;
private string _lobName;
private List<FactorValues> _factorValues; // Contains list of 5 objects
...

Factor Value Object:
...

private int _factorID;
private int _lobID;
private decimal _factorValue;

...

- I basically need to flatten this structure to display all the nested values on a Grid row.
- Be able to make changes to any cell in the grid using the batch update mechanism.
- Have those changes saved to my DataTable in the code behind
- Then transfer those changes back to my nested data structure before sending to database.


Regards,
Adrian
All times are GMT -5. The time now is 9:33 PM.
Previous Next