0

I have a WPF Datagrid in my application and as there are more that 25000 rows should be loaded I have created a custom pagination working with shortcut keys.

Now I am wondering if there is any way to detect whether the last row of current page is visited so I can load next page and append it to my Datagrid without any shortcut keys or click?

Update: I have added an event to vertical scrollbar for datagrid, and still can't find a way to determine whether the last row has brought to view or not?

Any suggestions?

amir moradifard
  • 353
  • 1
  • 8
  • 26
  • When you say "visited", do you mean brought into View? If yes, then [this question](http://stackoverflow.com/questions/658258/wpf-datagrid-check-visible-rows) may help. – Brian S Apr 23 '13 at 13:03
  • @BrianS, Yes I meant brought to view. Thanks for the link, but still can't replicate this solution. – amir moradifard Apr 24 '13 at 04:26

1 Answers1

0

OK, I found the trick:

following event helped me out:

> void dgScrollbar_ScrollChanged(object sender, ScrollChangedEventArgs
> e)
>         {
>             if (((System.Windows.Controls.ScrollViewer)(sender)).ContentVerticalOffset
> + e.ViewportHeight == e.ExtentHeight)
>             {
>                 LoadNextPageBinding_Executed(null, null);
>             }
>         }
amir moradifard
  • 353
  • 1
  • 8
  • 26