Hi,
In the xamdatagrid, I have a field with editor type as xamCheckEditor, after checking the checkbox, I move the focus out of the checkbox by clicking a ribbon outside of the xamDataGrid. While doing so, the lost focus event of the xamdatagrid is not fired, rather the functionality of the menu that I click is fired. So please let me know what could be the issue and also let me know how do we explicity trigger the edit mode ended of the current active record.
Thanks,
Balaji Rajendran
CCH- WK, Torrance , CA
Just to add to what Alex said. Basically things like toolbars, menus and the ribbon are within a different focus scope. The WPF GotFocus/LostFocus events are tied to logical focus (i.e. what element within the containing focus scope has focus) and is not tied to keyboard focus. That is why the LostFocus will not fire - because by interacting within a menu, toolbar or ribbon, you are not changing the logically focused element in that other element's focus scope. This same kind of thing will happen if you have focus in a TextBox since the textbox's default updatesource trigger is lostfocus.
Balaji,
I am not sure if there is currently a quick way around this issue. This is a Microsoft requirement for the Ribbon control. You can see the same issue in this forum thread.
Hi Alex,
Thanks for the reply, but there are numerous buttons in the application ribbon so it may not be practical to make implementation change for each click handlers. Plus because of the CAB & plug-in architecture, it is also possible that the event handler may not even have access to grid or may not be aware of the special logic. We need a central way for making the “grid to be self-aware” so that it can take care of logic related to the grid interaction.
CCH-WK, Torrance
Hello Balaji,
The tools in the ribbon are not supposed to take the focus, that is why the event is not firing. This is by design. The editor exposes EndEditMode(...) method, which you can use to explicitly end the edit mode.