Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing GridView
Message
From
28/01/2011 12:33:12
 
 
To
28/01/2011 12:30:15
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01497645
Message ID:
01497688
Views:
30
>>>>>>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?
>>
>>Yes, it's a BO. I think the MM.NET handles the re-binding, but how do I do that manually? GridView.DataBind()? If so I've tried that and it doesn't work.
>
>
>I know you got this solved with Naomi but wanted to add this comment. MM will do the rebinding but only if you update the business objects data. You were updating the dataset but not setting it back onto the business object. And that of course isn't needed so the solution you got is just fine. Just wanted to clear up that conception of the mm doing the re-binding for you. It will if you update the BO
>Tim

Thanks Tim
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform