Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
295
XamGrid - scrolling in code
posted
  • Hello, we are trying to use the xamGrid in an application that can also be used on a TabletPC. I am trying to implement a scrolling behavior like on the iPhone (elastic scroll), where you can drag anywhere withing the grid with your finger and make it scroll. There is some example code here http://sachabarber.net/?p=481 which works based on a ScrollViewer control.

- can the xamGrid scrolled in code, something like xamGrid1.ScrollToHorizontalOffset(500)?

- or does the xamGrid use an internal ScrollViewer and can I get access to that object in code?

Thanks,

Mike

Parents
No Data
Reply
  • 40030
    Offline posted

    Hi Mike, 

    The XamGrid handles scrolling itself. It doesn't use a scrollViewer, as it has to do some complex calculations to handle virtualization/recycling properly. 

    Also it's scrolling mechanism doesn't  work by pixels, but by the number of visible rows. So there isn't a method like ScrollToVerticalOvffset. 

    So in reality, the only way to do this is to write a custom RowsPanel and place it inside the XamGrid's ControlTemplate. However, it'd be pretty hard to modify. 

    -SteveZ

Children