I tried searching the forums but couldn't come up with a good answer.
I'm looking to do something that seems pretty straightforward...for a grid with X number of rows, I'd like to know when a user scrolls the last (X) row into view.
I tried listening for the AfterRowRegionScroll event, peeling off the last row from the VisibleRows collection, and testing if that row's index value == the row index of the last row in ultragrid1.Rows.
But I'm finding that the above condition is actually met earlier than it should be. As I scroll down, prior to reaching the end of my grid, the last row is populated in the VisibleRows collection...even though it isn't actually visible yet. (I should mention I have the Grid's ScrollBounds set to ScrollToFill.
Am I close and just need some sort of tweak? Is it just not possible to do what I'm trying to do?
Thanks!
That works like a champ. Thanks!
Hello ,
What you could do in your case is to use AfterRowRegionScroll event and to check if the row has UI element and if this UI element is fully visible. SO you could use code like:
if (e.RowScrollRegion.VisibleRows[e.RowScrollRegion.VisibleRows.Count - 1].Row.Index == ultraGrid1.Rows[ultraGrid1.Rows.Count - 1].Index)
{
UltraGridRow row = e.RowScrollRegion.VisibleRows[e.RowScrollRegion.VisibleRows.Count - 1].Row;
RowUIElement rowUI = row.GetUIElement() as RowUIElement;
if (rowUI != null && rowUI.IsFullyVisible )
Debug.WriteLine("Scroll Reach ");
}
I hope that this will helps you.
I should also mention that while I could probably make the Load On Demand paradigm work...that's not an option with the way I'm binding data.