Hi Marc - thanks for the response.
To clarify further my situation, I have a list of records in a datagrid
bound to a BindingList of custom business objects. Only a small number of
the possible properties of the business objects are shown in the datagrid.
The intention is that if a user wants to see more detail for that row, they
click on it and a PropertyGrid appears showing all the available properties
of the object. This works as correctly. When my data is loaded initially I
add a binding as follows
pgPropertyGrid1.DataBindings.Add("SelectedObject", this.BindingContext[d],
"Current");
However, in some instances, I don't want to show the full properties of a
row in the PropertyGrid. My plan therefor was to handle the
SelectedObjectsChanged event of the PropertyGrid and at that point check my
criteria as to whether the PropertyGrid should be enabled/disabled/visible
etc.
[quoted text, click to view] >there is no further liasing between thrGrid.SelectedObject and
>someClass.SomeProperty (in either direction) unless you deliberately code
>it that way by watching for change notifications.
It's a shame this is the case - how would you suggest I check for
notifications?
thanks
Andrew
[quoted text, click to view] "Marc Gravell" <marc.gravell@gmail.com> wrote in message
news:eunhrdTxHHA.2432@TK2MSFTNGP04.phx.gbl...
> SelectedObjectsChanged is called when you set the SelectedObject property
> (or SelectedObjects property if browsing the common properties for
> muiltiple objects) to a different value - not when something /on/ the
> selected object changes.
>
> When you talk about your breakpoint, how do you mean? The assignment step
> will not get repeated unless you deliberately invoke it - i.e. with
> theGrid.SelectedObject = someClass.SomeProperty;
> the someClass.SomeProperty property is executed once (only) and the
> returned value is passed to theGrid.SelectedObject; there is no further
> liasing between thrGrid.SelectedObject and someClass.SomeProperty (in
> either direction) unless you deliberately code it that way by watching for
> change notifications.
>
> Can you explain more about what you want to do? It sounds like the list
> would have to perform this checking via notifications...
>
> Marc
>