Hello. Im using RadPropertyGrid with some own class...
this class is like a this..
public class Person : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string name)
{
if(this.PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
private string name_;
private int age_;
public string Name { get { return name_; } set { name_ = value; OnPropertyChanged("Name"); } }
public string Age{ get { return age_ ; } set { age_ = value; OnPropertyChanged("AGE"); } }
}
public Form1()
{
InitializeComponent();
person=New Person();
person.Name="Chris";
person.Age=15;
person2=New Person();
person2.Name="Tom";
person2.Age=15;
radPropertyGrid1.SelectedObject=new object[]{person,person2};
}
public void AgePlusButtonClick(object sender,EventArgs e)
{
person.Age++;
person2.Age++;
}
but when I click AgePlusButton radPropertyGrid doesn changed.
thats why PropertyChanged is always null.
that changed when i clicked radPropertyGrid .
when I use selectedobject. that is work. but when i use selectedobjects. that doesn work..
how can I solve this one...
Thanks..
this class is like a this..
public class Person : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string name)
{
if(this.PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
private string name_;
private int age_;
public string Name { get { return name_; } set { name_ = value; OnPropertyChanged("Name"); } }
public string Age{ get { return age_ ; } set { age_ = value; OnPropertyChanged("AGE"); } }
}
public Form1()
{
InitializeComponent();
person=New Person();
person.Name="Chris";
person.Age=15;
person2=New Person();
person2.Name="Tom";
person2.Age=15;
radPropertyGrid1.SelectedObject=new object[]{person,person2};
}
public void AgePlusButtonClick(object sender,EventArgs e)
{
person.Age++;
person2.Age++;
}
but when I click AgePlusButton radPropertyGrid doesn changed.
thats why PropertyChanged is always null.
that changed when i clicked radPropertyGrid .
when I use selectedobject. that is work. but when i use selectedobjects. that doesn work..
how can I solve this one...
Thanks..