Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataBindings ignore programmatic property changes
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00922911
Message ID:
00922918
Vues:
13
This message has been marked as the solution to the initial question of the thread.
Hi Steve,

You need to add an event to notify the data binding system that your property has changed. Modify the Person class to look like this.
public class Person
{
    public event EventHandler NameChanged;
    private string _name;

    public Person(string name)
    {
        Name = name;
    }

    public Person()
    {
        Name = "";
    }
	
    public string Name
    {
        get { return _name; }
        set 
        { 
            _name = value; 
            if (NameChanged != null)
            {
                NameChanged(this, new EventArgs()); 
            }
        }
    }
}
For more details check out Windows Forms Data Binding and Objects by Rocky Lhotka.
---
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://www.msmvps.com/windsor
http://www.g6consulting.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform