UltraGrid. Select the tenth row for example (a total of about 150). Produce some actions, and then update the list. It is necessary that after updating, the highlighted row remained the same, rather than jumping on the first row. How to implement it?
P.S. Sorry for my English, I'm from Russia.
Hello FirsovAlexey,
Assuming that after that upgrade you would like to have again the tenth row selected you could do the following:
ultraGrid1.DisplayLayout.RowScrollRegions[0].FirstRow = ultraGrid1.Rows[10];
Please let me know if you have any other questions with this matter.
My solution of this problem:
UltraGridRow f_row;
UltraGridRow sel_row;
int sel_index;
f_row = GVOrdersInput.DisplayLayout.RowScrollRegions[0].FirstRow;
sel_row = GVOrdersInput.Selected.Rows[0];
sel_index = (int) GVOrdersInput.Selected.Rows[0].Cells["id"].Value;
some actions with updates.....
GVOrdersInput.DisplayLayout.RowScrollRegions[0].FirstRow = f_row;
foreach (VisibleRow row in GVOrdersInput.ActiveRowScrollRegion.VisibleRows)
{
if ((int)row.Row.Cells["id"].Value == sel_index)
GVOrdersInput.Rows[row.Row.Index].Selected = true;
break;
}
Thanks for the tip:) My example does not show the selected row in the list of the top, but it displays the selected row in the same place as before the update.
Hello,
Thank you for sharing your solution with the community.
Please feel free to let us know if you have any other questions.