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
490
AddNew + row.ParentCollection.Move collection scrolls to the end of the grid, leaving the new row outside the visible region
posted

We want to add a new row under the selected row.

We do it (roughly) with the following code:

int index = this.Grid.Selected.Rows[0].Index;
UltraGridRow row = this.Grid.DisplayLayout.Bands[0].AddNew();
row.ParentCollection.Move(row, index + 1);

This works fine except the grid is scrolled to the end. In longer grids, the added row remains outside the visible region.

Is it possible to add a new row under the selected row and still keep the selected row and the added row within the visible region?

PS: The solution proposed here is not an option for us.