I have a grid where I display trailers and the shipments on them in a child band. I recently added an arrival time column for when the trailer arrived and a column that shows how long the trailer has been at this location (TimeAtLocation property).
I added a timer that will on a defined interval recalculate the TimeAtLocation property. It fires the PropertyChangedEvent associated with INotifyPropertyChanged which updates the grid. All of this works fine.
However, I've noticed that when I select a row on the child-band and the timer updates the TimeAtLocation on the root-band, the active row on the child-band changes.
I've attached a much simplified version of my code that reproduced the issue along with the screenshots below illustrating the issue. Why might this be happening?
First image: sselecting a child-band row between timer tick.
Second image: selected row changes after timer tick.
Hello Jeffrey,
Each time you update a value in your BindingList this forces the ListChanged event to fire. UltraGrid listens to this event and changes the active row if it is fire. It seems that changing of parent band changes the position of the CurrencyManager in the child band, but this comes from Microsoft’s BindingList and we have no control over this. In the end child bind's list index is set to 0 and first row of child bind activates. What you can do to stop this behavior is set SyncWithCurrencyManager property of the grid to false like this:
ugTrailers.SyncWithCurrencyManager = false;
You may also check the following thread in our forum where similar question was discussed “ActiveRow changs unexpectedly”.
Please let me know if you need any further assistance on this.