I have a Editable Root Parent(TransactionHeader) with a Child List(TransactionDetails) that contains an amount field( Debit ). Also I have a Calculated Property in the parent TotalDebits. TotalDebits is updated using the ListChanged event. The TotalDebits field is used for validation and is also bound to a label in the UI
Editing of the child is done via a grid
The issue is everytime the TotalDebits property is updated by the ListChanged event the grid refreshes and sets focus back to the first row.
Is there a better way to handle totaling the child list.
I'm using Csla 2.14 and VB
Thanks
Mike
If I understand correctly, your root object handles ListChanged and loops through the children to re-total the value, then raises its own PropertyChanged to indicate that the total value is updated?
I do this sort of thing all the time without such an issue.
Something at the UI level is grabbing focus. Objects and events can't alter focus - it is almost certainly code in your UI that is the issue.
Do you have any UI code to handle ListChanged or PropertyChanged? Do you have any code handling a changed (or other) event for that textbox? Or any other control outside the grid?
Rocky,
Thanks for the help, I'll review my UI for the culprit
Thanks
Mike
Rocky,
As usual you were right. My UI was the issue.
I'm using a devexpress grid and they have a property KeepFocusedRowOnUpdate that defaults to true. When true it moves focus off new rows on update. Changing it to false solved my issue.
Thanks
Mike
Copyright (c) Marimer LLC