I have an UltraGrid that I would like to automatically scroll so as to keep the currently active row visible. Is there a setting that will do this or must it be done in code?
haggard said: I fail to see how the use of fixed rows aka pinned rows would address the problem which is that the use has pushed the down arrow key and the current row is below the visible portion of the list. The object is not to nail one particular row in place but to ensure that the currently active row is automatically scrolled into view.
I fail to see how the use of fixed rows aka pinned rows would address the problem which is that the use has pushed the down arrow key and the current row is below the visible portion of the list. The object is not to nail one particular row in place but to ensure that the currently active row is automatically scrolled into view.
Keep in mind that your inital post was only two sentences. Development specs vary and not everyone reading what you type will know the details of what you're working on. All three suggestions you got do exactly what you asked, but their usage depends on what you're really trying to achieve.
My suggestion for the fixed rows was that a lot of users editing grids scroll around if they are trying to read reference data from another row, so instead of using what the other guys suggested I saw fixed rows as possible answer. That active row will always be in view, and they can scroll around as much as they like while they are editing the row, and even pin other rows if they want to look at those while typing. Makes sense right? Use whatever you think works best for you.
So to use this method then I assume that a row selection changed event of some sort much be intercepted and this code inserted within?
The grid automatically tries to keep the ActiveRow visible by default. So you don't have to do anything.
But if it's scrolled out of view and you want to bring it into view, then the ScrollRowIntoView method or the FirstRow property on the ActiveRowScrollRegion is the way to go.
grid.ActiveRowScrollRegion.ScrollRowIntoView(grid.ActiveRow);