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
250
WinCombo Row Selection Causes Entity Update
posted

Suppose that you have an IBindable Generic.List of Entity Framework Customer Entities that serves as a BindingSource.DataSource and that serves as a WinCombo.DataSource.  If the user selects a WinCombo row that differs from its initial row, the WinCombo attempts to update the 1st row's EF Entity properties with the values of the 2nd row's EF Entity properties. 

This fails because one of the values that it attempts to update is the primary-key CustomerID.  The Customer Entity's { set } for Customer ID throws an error.

But none of this should have happened in the first place.  The user is merely selecting a different row - nothing has been edited - there's no reason to write anything.  I can't set e.Cancel = true w/in the WinCombo_Validating() method because WinCombo is attempting to { set } the CustomerID value BEFORE VALIDATION !

What is up with this wackiness?

Parents Reply Children
No Data