>>>Hi,
>>>
>>>I'm using Mere Mortals .NET 3.6 (not sure if that matters here or not).
>>>
>>>I've got an aspx page showing a header record and a gridview with child records displayed. I am using MM.Net's BOs but I think technically the gridview is bound to a dataset. When a value changes at the header level I need to recalculate some stuff in the child records and refresh the gridview. So I go through each datarow in the gridview's data set, recalculate one of the fields, then save the dataset to a session variable and do a GridView.DataBind().
>>>
>>>This does NOT show the newly calculated values, in fact the gridview disappears from the form completely.
>>>
>>>What am I doing wrong?
>>
>>What is the code you're using in the Load method of the ASP.NET form? Are you checking IsPostBack status to run your code? Also, are you saving the DS into a session variable or re-build it?
>
>Yes I check IsPostBack:
>
>
if (IsPostBack)
> {
> this.SetCurrentPolicy();
> }
>
>the dataset is saved to a session variable and SetCurrentPolicy has this code in it:
>
>
if (Session["dsPolicyRider"] != null)
> {
> DataSet dsPolicyRider = (DataSet)Session["dsPolicyRider"];
> this.oPolicyRider.SetCurrentDataSet(dsPolicyRider);
> }
What is this.oPolicyRider - is it a BO? Should you somehow re-bind the grid after setting the DataSet?
If it's not broken, fix it until it is.
My Blog