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
75
Maintain screen layout after grid refresh
posted

Hello,

We are using Infragistics Version 10.3.20103.1000 Ultragrid on one of the forms in our project.  In the CellChange event there is a call to our custom LoadGrid method.  This method resets the datasource to the latest version of data retrieved from the database.  This causes the focus to go back to the first cell in the first row.  I expect this behavior, but our users are requesting this be changed.

The requirement is that whatever the grid looks like when the user changes the cell, they want the screen to look like that after the grid is reloaded with fresh data.  Is this even possible?

I have tried a few ideas, but none have worked exactly the way we hoped.  The best I have come up with is to get the grid.ActiveRow.Index value at the beginning of the CellChange event and assign this value to a variable called "activeIndex".  Then after the grid is reloaded, I use the activeIndex value to access the row I want and then I know which cell I want the focus to be on, so I use the following two lines of code in an attempt to get the grid to go back to where it was before the CellChange event.  

gridInvoice.Rows(activeIndex).Cells("RebuttalStatusID").Activate()
gridInvoice.Rows(activeIndex).Cells("RebuttalStatusID").Selected = True

Unfortunately, this doesn't do exactly what we want.  I have attached a video showcasing the behavior.  I understand the screen will jump or the users will notice some movement from when the grid reloads and to when I activate and select the cell, but is there a way to make the scroll bars and appearance of the grid go back to the exact way it was the moment the user clicks the dropdown?

Thank you in advance!