VadimLou
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Код: ... fItemIndex: Integer; // какая то колонка для примера обращения. fRows: TList; // найденные строки ... ... begin fItemIndex := ... fRows := TList.Create; DataController.ForEachRow({SelectedRows:}False, ForEachRowProc); // для перебора всех записей // В вашем методе ForEachRowProc нужно учитывать возможность группировки и обхода групп: ... ... procedure xxx.ForEachRowProc(ARowIndex: Integer; ARowInfo: TcxRowInfo); var i: Integer; AValue: Variant; // procedure MyFilter(); // в идеале это выносится в событие var AFiltered: Boolean; begin AFiltered := Length(VarToStr(AValue)) > 5; // пример кастомного фильтра if AFiltered then fRows.Add(Pointer(ARowIndex)); end; // begin // check grouping: if (ARowInfo.RecordIndex <> DataController.NewItemRecordIndex) and (ARowInfo.Level < DataController.Groups.GroupingItemCount) then begin // ForEach grouped items: AGroupedRecordIndexesList := TList.Create; try i := DataController.Groups.ChildCount[DataController.Groups.DataGroupIndexByRowIndex[ARowIndex]]; AGroupedRecordIndexesList.Capacity := i; for i := 0 to fGroupedRecordIndexesList.Count - 1 do begin ARowIndex := DataController.GetRowIndexByRecordIndex(Integer(fGroupedRecordIndexesList[i]), {AMakeVisible:}True); // AValue := DataController.GetValue({RecordIndex}Integer(fGroupedRecordIndexesList[i]), {ItemIndex:}fItemIndex); MyFilter(); end; finally AGroupedRecordIndexesList.Free; end; end else begin AValue := DataController.GetRowValue(ARowInfo, {ItemIndex:}fItemIndex); MyFilter(); end; end; ... |
| Всего записей: 702 | Зарегистр. 22-07-2004 | Отправлено: 04:51 24-05-2012 | Исправлено: VadimLou, 05:12 24-05-2012 |
|