Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding Struct properties to Textboxes
Message
De
12/02/2008 10:48:55
 
 
À
11/02/2008 14:18:15
Irv Adams
MSC Managed Care, Inc.
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01291541
Message ID:
01291836
Vues:
4
So that means I should always use Class-based properties. I was just curious.

Yes, as Viv mentioned ... I'm pretty sure that it's the get/set methods of properties that make them work with Databinding.

~~Bonnie



>Oh that's right, I did read they were boxed because of value type. So that means I should always use Class-based properties. I was just curious.
>
>Thanks, Viv.
>
>Irv.
>
>
>>Hi,
>>
>>Don't think you can use Structs in this way - they are value based so when you use Databindings.Add() they get boxed and your textbox will be seeing this copy....
>>HTH,
>>Viv
>>
>>>I have a Winform with a Textbox bound to a Class property and a Textbox bound to a Struct property. I set both of them using Databindings.Add() and I see the underlying data values correctly.
>>>
>>>However, I cannot update the textbox Text with the Struct-based property using Databindings[0].Readvalue() but it works for the Class-based property.
>>>
>>>The Struct property will refresh Textbox if I reset with Databindings.Clear() and then Add() but I don't want to fully reset each time.
>>>
>>>Any ideas, thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform