Hello,
On a form with multiple grids, only the first grid added to the form gets the first row highlighted and selected. But how to get the N:th grid highlighted and selected on form load?
Kind regards
Try the following. In a client-side javascript function associated with the form create :
function SetGridFocus(sGridName) { var oGrid = eworkData.FieldByName(sGridName); if( oGrid ) oGrid.FocusCurrentRow(); }
Then call the function in the form's client extension properties like this:
OnLoad=SetGridFocus("myGridName")&Language=JScript
Thank you Scott,
In our processes we rely quite heavy on the grid-focus script, which do the trick, but makes the initial load a bit jumpy (gui wise) and (in some more complicated examples) messes up the tab order. I just thought that with SR3 you could somehow control which grid (or grid order) focus was set in designer, e.g by tab order or a grid priority.
However, while I evaluate SR3 I find that the grid- focus works well as long as the intended grid is added to the form first, before other grids. If the grid I intend to set focus on is added later on, I need to rebuild the form, or use script for multiple focus. This behavior does have a slight funny effect on some of our forms, where a grid on the bottom of the form is selected, the only reason it been added first, while the one on top is just highlighted.
just a thought do you use the tab order for anything in the form?
if not then maybe put the grid you are interested at the top of the form tab order
Only to mimic users workflow through the form, which is hard enough. Moving grids is possible in some cases but mostly will destroy the natural order of things.
I do welcome the change of the grid behavior, just expected it to be more configurable/flexible. Maybe that is something for the future?