We have a XamGrid that is displaying data from a PagedCollectionView that allows filtering. We have had to subclass the XamGrid and add code to get this to work as we would like.
When the XamGrid is loaded with a filter set the total number of displayed items isn't set to the correct value even though the data is filtered correctly. I'm trying to trace through the events to track down the problem and have found that the "Filtering" event is fired before the "Loaded" event.
Ideally I would like a "Loading" event that gets fired when the load operation starts so I can set our code into the correct mode, but there isn't such an event.
What is the order of events that fire when a XamGrid is loaded?
We are using v11.2 on Silverlight 5.
Hello Chris,
Thank you for your post. I have been looking into it, but I cannot be completely sure how your application is organized and how did you do the Filtering, so could you please send an isolated sample project, where the issue is reproduced, and more information about the result you want to achieve, so I could be able to think of a possible solution for you.
Looking forward for your reply.
Generating an isolated sample might be tricky - it's quite a complicated area - but I'll try. It may be a while as I'm out of the office for a week or so so I won't be able to get onto it straight away. I am assuming that it's something we're doing wrong in our extensions to the the XamGrid, which is why I was asking for which events are fired and in what order so I can track down our mistake.
In the meantime, if you can provide the list of events that fire when the grid is loaded that might be enough to help us solve the problem anyway. Ideally we'd like a "Loading" event to be the first thing that fires but in the absence of that knowing what event fires before the "Filtering" will do.
I can say that the ColumnLayoutAssigned event is fired before the Loaded event, which fires lastly. Also I can say that the Filtering and Filtered events doesn’t fire if the action is done by code.
Hope this helps you.
I've just checked this out and the ColumnLayoutAssigned event is fired after the Loaded event so doesn't help me.
Sorry.
I have created a sample project for you where everything seems to work ok on my side and the ColumnLayoutAssigned event fires before the Loaded. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Thanks for that and indeed it does fire the events in the order you say.
However, this has led me to the conclusion that neither of these events are what I need.
I need to know when the data has been filtered - but you said in an earlier reply that the Filtering and Filtered events aren't fired from code. I think this mush be what's happening here as the filter is already set up when the grid is loaded. The data is correctly filtered, but we're not getting the displayed items count (which is bound to the "ItemCount" of the PagedCollectionView) updated. It displays the total items in the collection, not the number of items that pass the filter.
I'm beginning to think I'm looking in the wrong area for the problem/solution.
Since I cannot be completely sure how you filter the data and how do you connected to the XamGrid, if you could send me an isolated sample, where your issue is reproduced, I will be able to investigate this further for you.
It will be better if you make a new post for your new question, if it is not related to this thread original one, so it could be found easily and the other users can benefit from the answers.
I haven't been able to work on this issue for the last week (other more important issues have come up). It is still something we need to solve, but I can't guarantee I'll have the necessary time to work on it.
I still need to narrow down the cause of the problem - when I do I'll post an update (or a new question if necessary).
Hello,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.