Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
490
Updating an unbound column
posted

I have a scenario where I am binding an object to my grid that contains a property that is another object. Then I am adding the second object's properties to the grid as unbound columns. Something like this:

Object1.ID

Object1.Object2

Object1.Name

 

Object2.State

Object2.City

 

So, for the above case my grid would have bound columns of ID and Name.  It would also have unbound columns of State and City.

When the underlying object (Object1) is changed, the grid automatically becomes aware of this and my cell text us updated with the new value (like if I change the Name property).  However, if the Object2 property of Object1 is changed... like changing the value of the "State" property, the grid will not update with the new value.  I am thinking this is because I made State an unbound column.  That makes sense to me.

My question is what event can I subscribe to in order to know when to refresh my unbound columns?  I am using a binding source with my grid, so I thought I could listen for the ListChanged event or something.  This did not fire when my property changed though.  How does the bound column know to update when I make that change there?

Thanks!

Steve