Windows Develop Bookmark and Share   
 index > Windows Forms General > How to make one property update another in a propetygrid
 

How to make one property update another in a propetygrid

I've been playing around with the PropertyGrid a bit. Just to see what can bee done.

I have one class, a point, and another, line, that contains a number of points

I made a ExpandableObjectConverter so the point's displayed as i want. (one line "X, Y Z" and one line for each value).

I added the [NotifyParentProperty(true)] so that when i type in a value for X the line with all three values are updated.

So far so good.

TheI added a property for "current point index" and another that displays the point at the given index.

But when i changed the index, the point are not updated. I made the point-property to show the point at current index.

It is updated when i click in the point property.

How can i make it to update whenI change the index ? Can this be done?

/Mats

Zatopek  Friday, October 17, 2008 2:44 PM
Hello,

I don't think you need a
NotifyParentProperty attribute (I don't think it's used by the grid). But what you need is a RefreshPropertiesAttribute (set to All if you want the content of the grid to be recreated, or Repaint if you just want to refresh the values of existing properties).

Best regards,

Nicolas Cadilhac @ VisualHint
Smart PropertyGrid.Net
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Smart FieldPackEditor.Net / DateTimePicker

VisualHint  Friday, October 17, 2008 3:44 PM
Hello,

I don't think you need a
NotifyParentProperty attribute (I don't think it's used by the grid). But what you need is a RefreshPropertiesAttribute (set to All if you want the content of the grid to be recreated, or Repaint if you just want to refresh the values of existing properties).

Best regards,

Nicolas Cadilhac @ VisualHint
Smart PropertyGrid.Net
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Smart FieldPackEditor.Net / DateTimePicker

VisualHint  Friday, October 17, 2008 3:44 PM

Yes!!!

That's what did it.

Thx

Zatopek  Friday, October 17, 2008 6:08 PM

You can use google to search for other answers

Custom Search

More Threads

• Determine Source Control of Drag Drop Operation
• How to change which form to open first?
• Memory leak, windows form containing an activex component.
• WndProc VisioViewer "Attempted to read or write protected memory"
• Treeview control
• Culture specific .dll's
• Print directly to dotmatrix printer
• How to use SetLocaleInfo in C# for change regional settiings of a system using c# code
• Switching between Console application and Windows Forms applications
• Textbox input