Hi,
several properties of the object attached to my RadPropertyGrid are of a custom type "DPDouble", which wraps some functionality around a double value.
In order to show and edit properties of this type in the Grid, I have implemented a custom type editor DPDoubleEditorNew which is called like this:
And the editor is based on this code:
Basically you see that I keep a pointer to the DPDouble object and when the editor is done I use the SetValueAuto as setter function.
This works fine, but although the bound object subscribes to INotifyPropertyChanged interface, and I raise the PropertyChanged event in the SetValueAuto setter function, my grid seems unable to catch the event.
My object has the following event
The RaisePropertyChanged gets called, but although my grid subscribes to the PropertyChanged event
the handler is never called.
It seems like the INotifyPropertyChanged is notifying somebody else than my grid.
Do you have any suggestions?
several properties of the object attached to my RadPropertyGrid are of a custom type "DPDouble", which wraps some functionality around a double value.
In order to show and edit properties of this type in the Grid, I have implemented a custom type editor DPDoubleEditorNew which is called like this:
01.void RequestEditors(object sender, Telerik.WinControls.UI.PropertyGridEditorRequiredEventArgs e)02.{03. PropertyGridItem item = e.Item as PropertyGridItem;04. if (item.PropertyType == typeof(DPDouble))05. {06. e.EditorType = typeof(DPDoubleEditorNew);07. }08. 09.}And the editor is based on this code:
public class DPDoubleEditorNew : BaseTextBoxEditor{ private DPDouble internalvalue; public override object Value { get { BaseTextBoxEditorElement element = this.EditorElement as BaseTextBoxEditorElement; double myval; if(double.TryParse(element.Text,out myval)) { internalvalue.SetValueAuto(myval); } return internalvalue; } set { internalvalue = (DPDouble)value; base.Value = internalvalue; } }}Basically you see that I keep a pointer to the DPDouble object and when the editor is done I use the SetValueAuto as setter function.
This works fine, but although the bound object subscribes to INotifyPropertyChanged interface, and I raise the PropertyChanged event in the SetValueAuto setter function, my grid seems unable to catch the event.
My object has the following event
public event PropertyChangedEventHandler PropertyChanged; public void RaisePropertyChanged(String info) { if (PropertyChanged != null) { PropertyChangedEventArgs args = new PropertyChangedEventArgs(info); PropertyChanged(this, args); } }The RaisePropertyChanged gets called, but although my grid subscribes to the PropertyChanged event
PropertyGrid.PropertyChanged += new PropertyChangedEventHandler(PropertyGrid_PropertyChanged);the handler is never called.
It seems like the INotifyPropertyChanged is notifying somebody else than my grid.
Do you have any suggestions?