Jump to content

Mobile TUnimDBListGrid Select Row In Code - How ?


andyhill

Recommended Posts

procedure TfMain.ListGridAfterLoad(Sender: TUniCustomDBGrid);
var
  DBGridJSName: string;
  _RecNo: Integer;
begin
  ListGrid.SetFocus;
  if ListGrid.DataSource.DataSet.RecordCount > 0 then begin
    ListGrid.DataSource.DataSet.First;
    DBGridJSName:= ListGrid.JSName;
    _RecNo:= 1;
    UniSession.AddJS(DBGridJSName + '.getSelectionModel().select('+ DBGridJSName +'.getStore().data.indexOfKey('+ IntToStr(_RecNo) +'), true)');
  end;
end;

Please advise how to do this for TUnimDBListGrid - thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...