Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Databinding to an object
Message
De
28/09/2006 10:09:34
 
 
À
28/09/2006 09:12:45
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Programmation orienté objet
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01157683
Message ID:
01157828
Vues:
34
First, let me say that my DataBinding is almost exclusively done with DataSets/Table.

But, this is interesting. If I bind a TextBox to a property of my Form, it works just fine. A change to the propety's value is properly reflected in the TextBox. However, if that property is not a property of the Form and is a property of a class, for some reason I'm not seeing it work properly ... just as you have posted.

I know I've played around with DataBinding properties before (but only "play", not in real work) and it has seemed to work ... but I've probably not tried this before ... binding to a property in a class. Also, I know I've only played with it in 1.1, not 2.0 (not that that should make any difference ... I doubt that they broke it in 2.0! <g>)

I'm sure it's probably some attribute that you need to add to your class, just not sure what it is off the top of my head (but you can try and research that a bit yourself).

~~Bonnie



>
>Public Class Wire
>
>    'Fields
>    Protected m_name As String
>    Protected m_color As String
>    Protected m_guage As Integer
>
>    'Properties
>    Public Property Name()
>        Get
>            Return m_name
>        End Get
>        Set(ByVal value)
>            m_name = value
>        End Set
>    End Property
>
>    Public Property Color()
>        Get
>            Return m_color
>        End Get
>        Set(ByVal value)
>            m_color = value
>        End Set
>    End Property
>
>    Public Property Guage()
>        Get
>            Return m_guage
>        End Get
>        Set(ByVal value)
>            m_guage = value
>        End Set
>    End Property
>
>End Class
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform