Updating a PropertyGrid

  • Thread starter Thread starter Lance
  • Start date Start date
L

Lance

Is there any way to tell a Windows.Forms.PropertyGrid to
update the values for the properties that it is
displaying? I am having trouble getting the PropertyGrid
to update when I make changes to the SelectedObject's
properties outside of the PropertyGrid.

If I use the PropertyGrid to change the SelectedObject's
properties then everything works as expected (even when
one property causes another property to change, etc.).
But, if I change a property value programically then the
PropertyGrid does not update (even though the appropriate
PropertyChanged event was fired).

A method that is used to set the value programically
might look something like this:

Sub SetLeft(ByVal value As Single)
If (Me._Left = value) Then Exit Sub
Me._Left = value
Call Me.OnLeftChanged()
End Sub

Thanks for any help.
Lance
 
Hi Lance,

You may try to call the
PropertyGrid1.Refresh()
to see if the problem persists.

If you have any problem, please post in here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top