Unexpected ListChanged event

Posts   
 
    
heerser avatar
heerser
User
Posts: 36
Joined: 15-May-2005
# Posted on: 13-Nov-2011 22:27:39   

Hi ,

I have a question regarding LLBLGen 2.6 in a “Adapter .TwoClasses2010” scenario:

In WPF a control loses focus to the mainwindow when the user tabs after updating a field when the databound entity is part of a **sorted **enitityview. This is annoying because the user is expecting the focus to the next field in the grid. So apparently there's some event causing this behavior?

thanks!

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Nov-2011 10:23:30   

Please specify the LLBLgen Pro runtime library version (build no.).

heerser avatar
heerser
User
Posts: 36
Joined: 15-May-2005
# Posted on: 14-Nov-2011 10:31:52   

latest: 2.6.11.0427

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Nov-2011 10:54:40   

This might be an isue in WPF, or somewhere else. Could you please attach a simple repro solution (preferably based on Northwind).

heerser avatar
heerser
User
Posts: 36
Joined: 15-May-2005
# Posted on: 14-Nov-2011 11:53:10   

example attached

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Nov-2011 15:22:26   

Got your solution, and I can see the issue. Only occurs when binding to a sorted EntityView.

I'm looking into it.

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Nov-2011 15:36:40   

If you handle GotFocus of the second TextBox, and edit the first one and press Tab, the calls get to the GotFocus event handler.

So the focus transfers correctly, but it's not seen by the user, don't know why !!.

(Edit) Ok, Then instantaneously the second textBox loses focus to the mainWindow !!. Can be detected by handling LostKeyboardFocus.

heerser avatar
heerser
User
Posts: 36
Joined: 15-May-2005
# Posted on: 14-Nov-2011 16:00:52   

I think its due to the ListChangedType of the raised ListChanged event:

unsorted its just ItemChanged but when sorted its Reset !

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 14-Nov-2011 16:05:35   

Ok got it.

Please add the following:

view.DataChangeAction = PostCollectionChangeAction.NoAction;

As by default the EntityView re applies the sorter and filtering when an item is changed.

heerser avatar
heerser
User
Posts: 36
Joined: 15-May-2005
# Posted on: 14-Nov-2011 16:31:24   

Ok, I was afraid you might say that wink Maybe in the next version LLBL could check to see if the updated field is part of the sort expression before calling a reset.

Thanks for the help!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 15-Nov-2011 11:01:07   

Added to todo list, but won't be in v3.5

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 31-May-2018 10:35:14   

Implemented in the upcoming v5.5

Frans Bouma | Lead developer LLBLGen Pro