- 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
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
I have another question on this topic. If I add a row to the grid programmatically and then select it in code by adding the row to SelectedRows collection then the row gets selected but the grid doesnt scroll rows to make selected row appear on the screen. Is it possible to make the grid do it?
Thank you,
Eugene
Perfect. Thank you.
ek2011 said: I have another question on this topic. If I add a row to the grid programmatically and then select it in code by adding the row to SelectedRows collection then the row gets selected but the grid doesnt scroll rows to make selected row appear on the screen. Is it possible to make the grid do it? Thank you, Eugene
Hi,
In that case you can use the ScrollCellIntoView method of the XamGrid.
HTH