I have attached a sample app that shows my issue.
I have details inside the zipped project sample itself.
It is a very particular issue in the sense of deferred scrolling and thumb scrolling to the very top or bottom. Clicking the up/down arrows on the scroll bar do not reproduce the issue. Moreover thumb scrolling to just before the very bottom or just before the very top also does not reproduce the problem. So please be aware of this. Lastly changing the scroll mode to immediate fixes the problem, but in my situation I need it to be deferred.
1. Xamdatagrid with deferred scrolling
2. Event tied to ScrollViewer.ScrollChanged. This is where I inspect the indexes of the visible rows.
3. Thumb scrolling the data grid all the way to the very bottom or all the way to very top, I do not see the scrollchanged event fire for those rows. I bolded below the 2 lines of code important to this issue.
private void xamDataGrid1_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
//I expect to see every visible row index come through here. If I thumb scroll all the way to the bottom, I do not.
Infragistics.Windows.DataPresenter.Record[] ViewableRows = MainGrid.GetRecordsInView(false);
debugCounter++;
WriteOutLocally(debugCounter.ToString() + ". " + ViewableRows[1].Index.ToString() + " - " + ViewableRows[ViewableRows.Length - 1].Index.ToString());
}
Here is what the log file that I write out looks like, notice after thumb scrolling all the way to the bottom it says the visible rows are still 1-18. I suspect the very last scroll change event did not happen:
1. 1 - 18 6/14/2012 5:36:04 PM
2. 1 - 18 6/14/2012 5:36:04 PM
3. 1 - 18 6/14/2012 5:36:07 PM
4. 1 - 18 6/14/2012 5:36:07 PM
5. 1 - 18 6/14/2012 5:36:07 PM
6. 1 - 18 6/14/2012 5:36:07 PM
7. 1 - 18 6/14/2012 5:36:07 PM
8. 1 - 18 6/14/2012 5:36:07 PM
9. 1 - 18 6/14/2012 5:36:07 PM
10. 1 - 18 6/14/2012 5:36:07 PM
11. 1 - 18 6/14/2012 5:36:07 PM
12. 1 - 18 6/14/2012 5:36:07 PM
13. 1 - 18 6/14/2012 5:36:07 PM
14. 1 - 18 6/14/2012 5:36:07 PM
15. 1 - 18 6/14/2012 5:36:07 PM
16. 1 - 18 6/14/2012 5:36:07 PM
17. 1 - 18 6/14/2012 5:36:07 PM
18. 1 - 18 6/14/2012 5:36:07 PM
19. 1 - 18 6/14/2012 5:36:07 PM
20. 1 - 18 6/14/2012 5:36:07 PM
21. 1 - 18 6/14/2012 5:36:07 PM
22. 1 - 18 6/14/2012 5:36:07 PM
23. 1 - 18 6/14/2012 5:36:07 PM
24. 1 - 18 6/14/2012 5:36:07 PM
25. 1 - 18 6/14/2012 5:36:07 PM
26. 1 - 18 6/14/2012 5:36:07 PM
27. 1 - 18 6/14/2012 5:36:07 PM
28. 1 - 18 6/14/2012 5:36:07 PM
29. 1 - 18 6/14/2012 5:36:07 PM
30. 1 - 18 6/14/2012 5:36:07 PM
31. 1 - 18 6/14/2012 5:36:07 PM
32. 1 - 18 6/14/2012 5:36:07 PM
33. 1 - 18 6/14/2012 5:36:07 PM
34. 1 - 18 6/14/2012 5:36:07 PM
35. 1 - 18 6/14/2012 5:36:07 PM <-- im looking at records 982 - 1000 but it never hits the scroll change event.
Hello,
I have been looking into requirement and there doesn’t seem to be such an event that fires at the particular moment you need. This is why I have taken the liberty of submitting a Product Idea on your behalf so that this might be implemented in a future volume release of ours. I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development, you will be notified at that time. Your friendly ID for this Product Idea is PI12070126.
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Please let me know if I can be of any further assistance on this matter.
Yes I am using the work around suggested which I marked as the answer.
Let me clear up my lingo:
Short Objects - Basically an ID and a name, no loaded relationships, very quick to read in, fast but lazy.
Long Objects - a fully loaded, heavy related object. Slow and eager loaded.
With that background when a grid loads, we only load long objects into what is view-able at the time and short objects for everything else. So if a record set is 100. only 15 or 20 would be long objects the rest would be short objects. Whenever a scroll event happened we would swap out short objects for long objects, so this introduces a delay for a database hit, in which the UI would pause and wait. To get around that issue we took advantage of Scrolling mode deferred. This worked perfectly until a full thumb scroll to the very bottom or very top which i submitted a project to represent. We use short objects as place holders that get swapped for heavier objects when they come into view. This is mostly for delaying/spreading out loading times.
So that is why the event records in view changed is a little late for our situation because we never want to show short objects, only long objects. Using the suggest work around we see a list of short objects until the long objects are loaded from the database. However, I realize this situation is unique to us and I have to decided to live with this short coming.
I am just checking if you got this worked out, or you still require any assistance, or clarification on the matter.
Hello DeathDragon,
I have been looking into your explanation and I am still having a hard time understanding what is the issue you are having with scrolling. Also it may be useful to know why have you decided on swapping records while scrolling and what exactly do you mean by “short objects” and “long objects”. If possible attach a test sample that actually does all that so I can get a better understanding of your scenario.
Looking forward to hearing from you.
The above suggestion did help me in this issue. However, it is not ideal. If you are trying to swap out records before they come into view, in my case I am swapping out place holder records (short objects) for the latest record data (long records), this solution exposes those records for a second or two until the latest data is retrieved.