Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Databinding Issue
Message
From
19/11/2010 15:04:06
 
 
To
19/11/2010 14:16:09
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01489807
Message ID:
01489826
Views:
36
>Viv
>
>>>Does the object you are binding to support change notification ?
>
>I'm binding to the datatable column, which is updated from an object.
>
>According to the MSDN doc, the datatable does change notification on its own.

I thought you said one that wasn't working was bound to an object? :
"The only difference I can see is the data in the first case is coming from a datatble, while in the second case it's coming from properties in an object "




>>
>>When this code executes, the textboxes associated with the updated columns refresh immediately on the form
>>
>>
>
>>// Populate the ship-to if indicated
>> soInformation.somastds.soaddr[0].company = soInformation.somastds.somast[0].fname.TrimEnd() +
>> " " + soInformation.somastds.somast[0].lname.TrimEnd();
>> soInformation.somastds.soaddr[0].address1 = soInformation.somastds.somast[0].address.TrimEnd();
>> soInformation.somastds.soaddr[0].city = soInformation.somastds.somast[0].city.TrimEnd();
>> soInformation.somastds.soaddr[0].state = soInformation.somastds.somast[0].state.TrimEnd();
>> soInformation.somastds.soaddr[0].zip = soInformation.somastds.somast[0].zip.TrimEnd();
>>
>
>>
>>
>>
>>In the code below, before I added the code at the bottom that cleared and reset the bindings, the associated textboxes would not refresh.
>>
>>The only difference I can see is the data in the first case is coming from a datatble, while in the second case it's coming from properties in an object.
>>
>>I know the original binding worked because the textboxes showed the correct values. When the values changed, however, nothing happened.
>>
>>Am I missing something?
>>
>>Is there an easier way to refresh bindings?
>>I browsed the web and found some old tools that no longer work.
>>
>>
>>
>>
>>
>>
>>
>
>> if (soInformation.somastds.soline[0].pwidft != 0 &&
>> soInformation.somastds.soline[0].plenft != 0)
>> {
>> feetandinches Overlaplength = soInformation.GetOverlapValue(soInformation.somastds.soline[0].overlapid);
>> feetandinches coverwidth = CalculateFeetandInches(soInformation.somastds.soline[0].pwidft,
>> soInformation.somastds.soline[0].pwidin, Overlaplength.Feet, Overlaplength.Inches);
>> soInformation.somastds.soline[0].cwidft = coverwidth.Feet;
>> soInformation.somastds.soline[0].cwidin = coverwidth.Inches;
>> feetandinches coverlength = CalculateFeetandInches(soInformation.somastds.soline[0].plenft,
>> soInformation.somastds.soline[0].plenin, Overlaplength.Feet, Overlaplength.Inches);
>> soInformation.somastds.soline[0].clenft = coverlength.Feet;
>> soInformation.somastds.soline[0].clenin = coverlength.Inches;
>> }
>> textBoxCwidft.DataBindings.Clear();
>> textBoxCwidin.DataBindings.Clear();
>> textBoxClenft.DataBindings.Clear();
>> textBoxClenin.DataBindings.Clear();
>> textBoxCwidft.DataBindings.Add("Text", soInformation.somastds.soline, "cwidft");
>> textBoxCwidin.DataBindings.Add("Text", soInformation.somastds.soline, "cwidin");
>> textBoxClenft.DataBindings.Add("Text", soInformation.somastds.soline, "clenft");
>> textBoxClenin.DataBindings.Add("Text", soInformation.somastds.soline, "clenin");
>>
>
>Does the object you are binding to support change notification ?
>( http://msdn.microsoft.com/en-us/library/xz45s2bh.aspx )
>
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform