powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Delphi [игнор отключен] [закрыт для гостей] / CXGrid view.DataController.RecNo дает не верное значение, или
3 сообщений из 3, страница 1 из 1
CXGrid view.DataController.RecNo дает не верное значение, или
    #39811548
yemets63
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
очередной последний штрих, и вижу, что не получилось


как сразу сделать выделение строки если я нашел запись

if view.DataController.DataSource.DataSet.Locate('FIELDNAME','value',[])=true then
сделать ViewData.Rows selected
...
Рейтинг: 0 / 0
CXGrid view.DataController.RecNo дает не верное значение, или
    #39811567
Dmitri Krizhanovski
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
yemets63,

Код: pascal
1.
2.
3.
4.
5.
if locate is true then //if View.DataController.LocateByKey(KeyValue) then
begin
  View.Controller.ClearSelection;
  View.Controller.FocusedRecord.Selected := True
end;


TcxDBDataController.LocateByKey(c) DevExpress

TcxDBDataController.LocateByKey
TcxDBDataController
--------------------------------------------------------------------------------

Finds and focuses the record containing the specified key field values.

Syntax
function LocateByKey(const AKeyFieldValues: Variant): Boolean;
Description

This function locates the record with the specified key field value(s). The AKeyFieldValues parameter should specify a variant or an array of variant values corresponding to the key field(s) set via the KeyFieldNames property.

The function returns True when the appropriate record is found and focused (in ExpressQuantumGrid, the view's OnFocusedRecordChanged event is fired when changing the focused record). If the record doesn't exist or no key field names are assigned, LocateByKey returns False.


The LocateByKey function does not force the reloading of dataset data, since it searches its internal buffer. The dataset's Locate method also allows you to locate records with specific criteria. However, each call of Locate forces the data controller to reload data from the dataset, thus slowing down performance, especially for large datasets. To prevent data reloading when moving the cursor within the dataset, you can enclose call(s) to Locate within the BeginLocate and EndLocate methods.
...
Рейтинг: 0 / 0
CXGrid view.DataController.RecNo дает не верное значение, или
    #39811593
yemets63
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Dmitri Krizhanovski,

точно View.Controller.FocusedRecord.Selected

спасибо
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Delphi [игнор отключен] [закрыт для гостей] / CXGrid view.DataController.RecNo дает не верное значение, или
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]