Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web Form
Message
De
06/07/2009 15:32:35
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
01409563
Message ID:
01410350
Vues:
35
Eric, Bob,

Sorry I was away for a few days and not thinking about any of this stuff for a change. I actually had to look back through this thread a bit to see what we were talking about.

There isn't a lot of examples of web stuff in the Dev Guide at this point but I think a pretty good example under the Third Party Controls | Infragistics Web Controls | mmUltraWebGrid | Updating in batch mode.

It might not sound relevant, but I can tell you I recently spent way too many hours working through this example with different controls and trying to figure things out. MM provides two way binding unlike typical ASP.net controls. If you save the dataset to the session, you can get access to it back again from the session on the save. Since you are re-creating the business object, you need to set this saved DataSet as the current dataset on the business object. In the example above this is done in the LoadUpdateableDataSet method and called before a save is attempted. After which you should have the same DataSet bound to the control and is current on the business object and thus you have something to work with.

Retrieving data over again in the page load in some cases will overwrite any changes you may have made in the control unless you turn off two way binding and navigate the control yourself to get changed values. Not that what Bob is doing is wrong in his case. It is a difficult challenge to figure some of this stuff out for different situations and has been a big challenge. You have to think in terms of each post back is a new day except for what you recreate or save; and you need to know the order it all occurs again.
Good luck
Tim

>Eric,
>
>I do not see how this changes anything as all my web forms in my app do not do this. I always set the session variable for the dataset in the Page_Load regardless of postback status and everything works fine. So I am at a loss as to why this works for you. In fact, I would think that the dataset values will not be saved properly.
>
>When you now click the save button you will set the oOrder.Dataset to the session variable that was created in your original load of the page and then the same line of code will be executed again in the Save_click method. That doesn't seem right to me. What if you had multiple postbacks due to server requests for dropdown boxes or business rules failed that caused other postbacks, etc. Your session variable for the dataset will never change and I think you would not have the proper values stored.
>
>The fact that the dev guide does not instruct this tells me that this is not the way to do this. Again, as I mentioned previously, I do not know the inner workings enough to say that this is correct or not. But, I would be cautious.
>
>Hopefully, Tim chimes in here again as I am sure he would be able to give you more insightful perspective on the inner workings.
>
>HTH
>
>
>>Ok, I think I see what I had to do, but correct me if I'm wrong. I tweaked the page_load to look like this:
>>
>>
>>        if (IsPostBack)
>>        {
>>            this.oOrder.DataSet = (DataSet)Session["dsOrder"];
>>        }
>>        else { Session["dsOrder"] = this.oOrder.DataSet; }
>>
>>
>>This brings the bound values back properly when their trying to save the order, and now they're available when I get down to the btnSave_Click(). I don't see examples like this in the dev guide though, which makes me wonder.
>>
>>Thanks everyone!
>>
>>Eric
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform