Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Databinding refresh
Message
From
01/12/2004 17:40:29
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00966178
Message ID:
00966227
Views:
7
Well, there's probably a few ways to handle this. We don't run into this issue because we're using WebServices rather than Remoting and all our queries are returned as XML (then in the UI we simply fill the existing DataSet from the XML).

So, you could do something similar to that (using XML), I suppose, but I doubt if it's the most efficient methodology.

You could also have a DataBind method on your form that you call when you initially get the data and call again when you refresh the data.

Those two things are the first things that spring to mind ... not much help, huh? <g>

~~Bonnie


>Thanks Bonnie,
>
>How would i refresh the existing DataSet with the tables contained in the new dataset i received from my new query ?
>
>>I'm pretty sure that the problem lies with the fact that you are probably recreating the DataTable every time. If instead the existing DataTable could be cleared with _cust.AR_CustMaster.Clear() and then filled (all in your server method probably) then your data bindings would not get lost.
>>
>>~~Bonnie
>>
>>
>>
>>>It's a typed dataset, received from a server method (via remoting)
>>>
>>>>Hi Stephane,
>>>>
>>>>How are you refreshing your data? Is _cust.AR_CustMaster a table?
>>>>
>>>>~~Bonnie
>>>>
>>>>
>>>>
>>>>>I a form i have a dataset and i bind a field to a text box:
>>>>>
>>>>>
>>>>>this.textBox1.DataBindings.Add("Text", _cust.AR_CustMaster, "Name");
>>>>>
>>>>>
>>>>>this works fine but if i refresh the dataset with some new data the binding does not refresh. but if i execute this code after the dataset refresh:
>>>>>
>>>>>this.textBox1.DataBindings.Clear();
>>>>>this.textBox1.DataBindings.Add("Text", _cust.AR_CustMaster, "Name");
>>>>>
>>>>>
>>>>>The new binding works fine.
>>>>>
>>>>>My question is: is this the way to do (recreating all bindings after a data refresh) or there's some kind of magic method i haven't found yet ?
>>>>>
>>>>>Thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform