For our project we save and load layouts using the built in xamdatagrid.Load/SaveCustomizations methods. For our grid, we apply custom logic when a filter is applied to the grid by looking at the Record Filter Changed event of the grid, but this event is never fired when we load customizations, even though it applies filters. Does anyone have any suggestions on how to handle this (possibly how to know when all customizations have been loaded)? We have tried looking at the Field Layout Initialized event, and although it fires based on the customizations we load, the field layout doesn’t contain the record filters at the point that the event is fired.
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
The way I got around this problem was to created a static routed event that is manually raised on the xamDataGrid after customization have been loaded. You can then register for the event from any UI control in the visual tree. This approach is more efficient than listening for the Initialized or RecordsInView events especially if you are in control of when customization is loaded, also it doesn't require additional state variable to remember when load was called
Hello Shawn,
I believe that the events I suggested you are the available ones at the moment that you can use. If I think of a better way for achieving the functionality yo uwant I will let you know.
Although it works, it is extremely inefficient because we have no way of knowing if the layout update is due to new data coming in or because of load customizations finishing, so if we load customizations, every time the grid updates, we need to perform the expensive custom logic which slows down our grids refresh rate. Is there any more deterministic way of knowing when it is finished?
There isn't a particular event that fires after the customizations are loaded, this is why I suggested yo uuse the RecordsInViewChnaged event or LayoutUpdated. Does the RecordsInvIewChnaged event work for you or you tried only the LayoutUpdated? If thee both doesn't fulfill your requirements I can log a product idea on your behalf.
Looking forward for your reply.