x11 Posted January 10, 2022 Share Posted January 10, 2022 Теряется сфокусированная запись. Может какое-то свойство надо включить или отключить? После переоткрытия набора данных теряется выбранная запись. procedure TfrdNotes.actOpenUpdateExecute(Sender: TObject); Var id: variant; begin inherited; if qData.RecordCount > 1 then id := qDataID.Value else id := null; qData.Close; qData.ParamByName('ID_USER').AsInteger := UniMainModule.UserData.UserID; qData.Open; if not VarIsNull(id) then if qData.RecordCount > 1 then qData.Locate('ID', id, []); end; Строка "qData.Locate('ID', id, []);" выполняется. А что дописать, чтобы в сетке автоматически фокусировалась нужная запись после locate? Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 10, 2022 Share Posted January 10, 2022 1 hour ago, x11 said: Строка "qData.Locate('ID', id, []);" выполняется. В каком месте? Quote Link to comment Share on other sites More sharing options...
x11 Posted January 11, 2022 Author Share Posted January 11, 2022 В смысле "в каком месте"? На форме есть кнопка, пользователь ее нажимает и набор данных переоткрывается. Quote Link to comment Share on other sites More sharing options...
x11 Posted January 11, 2022 Author Share Posted January 11, 2022 17 hours ago, Sherzod said: В каком месте? я снимок окна прикрепил, там видна таблица и кнопка Обновить (2 стрелки) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 11, 2022 Share Posted January 11, 2022 1 hour ago, x11 said: я снимок окна прикрепил, там видна таблица и кнопка Обновить (2 стрелки) Вы должны перенести код в событие OnAfterLoad. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.