Page 1 of 1

Focus row of TIWCGJQGrid by code

PostPosted: 29 Oct 2019 12:29
by antonsanta
I've a grid with users and would like to focus the row with actual logged user when the user-grid is shown. I tried to set the
JQGridOptions.jsSetSelection(UserSession.memUtentiID.AsString, true)
and also with
JQGridOptions.SelRow := UserSession.memUtentiID.AsString;
followed by a
AjaxReRender(true, true);
but both do not highlight (show focused) any row of the grid.
the ID-field of the dataset is the key-field of the grid.
How can I accomplish this?
thanks and best regards

Re: Focus row of TIWCGJQGrid by code

PostPosted: 30 Oct 2019 02:43
by SaturnValley

You have to save the rowid you want to select in a private member of the form/frame, lets say FRowIdToSelect: string and call grid.JQGridOptions.SetSelection(FRowIdToSelect) on grid.JQGridOptions.OnSelectRow