Platform: LLBLGen 2.6, VS2008, .NET 3.5
Runtime Scenario:
Form1: has an Employee combo-box populated from an Employee entity collection's ToList()
employeeEC.ToList();
Form2: this form shows details of the Employee entity.
Symptom:
1- at runtime Form1 is opened and then Form2 is opened,
2- change any of the Employee information in Form2
3- the SelectedIndexChanged event of the employee combo-box in Form1 fires!!
if the data-source of the combo-box is set directly using the EntityCollection (without ToList()) then the above does not happen.
The importance of ToList() is that we often use a Linq query as a data-source for a combo-box, and we use the Linq query's ToList() to bind the query result to the combo-box (to allow us to insert into the list an empty element for example).
This is leading to Edit forms firing events in combo-boxes (in other opened form)s that are bound to the same Type of entity.
Is this behavior by design? and what design we should follow to avoid this side effect?