解决方案 »
- 一句(关键)代码实现全透明_完美版
- 在DELPHI中如何调用JAVA的WEB SERVICE
- 如何将excel表导入sql数据库?
- 如何将类似select * from :DB.Table 加入TQuery?
- delphi7里smtp哪里去了?
- 在类似于dbgrid的控件中,怎么样使数据单数行显示为红色,双数行显示为黑色?即第1.3.5.7.9.11...的记录显示为红色,2.4.6.8.10....的记
- 一个屏幕键盘程序如何在不同的FORM中都可使用
- 在线等待,谁有Delphi中报表QuickReport的汉化包
- 截取WM_HSCROLL和WM_VSCROLL的消息!!
- 怎么把一幅图片设为窗体的被景?
- 被千万收购的Windows优化大师是如何构造的?
- 生成按钮,单击事件释放问题 ,求解
//这里可以按你的选项处理
function Compare(const ARecIndex, AColIndex: integer): boolean;
begin
Result := AnsiContainsText(AView.DataController.DisplayTexts[ARecIndex, AView.VisibleColumns[AColIndex].Index], AText);
end;var
GroupsIndex: integer;
GroupsCount: integer;
ChildCount: integer;
ColIndex: integer;
RowIndex: integer;
RecIndex: integer;
CurIndex: integer;
i, j, k: integer;
begin
Result := false;
AView.DataController.ClearSelection; if AFromBeginning then
begin
AView.DataController.GotoFirst;
RowIndex := 0;
ColIndex := 0;
end
else
begin
RowIndex := AView.Controller.FocusedRowIndex;
ColIndex := AView.Controller.FocusedColumnIndex; if AView.Controller.FocusedColumn.IsLast then
begin
ColIndex := 0;
Inc(RowIndex);
end
else
begin
Inc(ColIndex)
end; end; if AView.DataController.Groups.GroupingItemCount = 0 then
begin
for i := RowIndex to AView.ViewData.RowCount - 1 do
begin
RecIndex := AView.ViewData.Rows[i].RecordIndex;
if RecIndex = -1 then
Continue; for j := ColIndex to AView.VisibleColumnCount - 1 do
begin
Result := Compare(RecIndex, j);
if Result then
begin
AView.Controller.FocusedRecordIndex := RecIndex;
AView.Controller.FocusedColumnIndex := j;
Break;
end;
end; ColIndex := 0;
if Result then
Break;
end;
end
else
begin
GroupsCount := TcxDataControllerGroupsProtected(AView.DataController.Groups).DataGroups.Count;
GroupsIndex := AView.DataController.Groups.DataGroupIndexByRowIndex[RowIndex];
for i := GroupsIndex to GroupsCount - 1 do
begin
ChildCount := AView.DataController.Groups.ChildCount[i];
for j := 0 to ChildCount - 1 do
begin
RecIndex := AView.DataController.Groups.ChildRecordIndex[i, j];
if RecIndex = -1 then
Continue; CurIndex := AView.DataController.GetRowIndexByRecordIndex(RecIndex, false);
if (CurIndex > -1) and (CurIndex < RowIndex) then
Continue; for k := ColIndex to AView.VisibleColumnCount - 1 do
begin
Result := Compare(RecIndex, k);
if Result then
begin
AView.Controller.FocusedRowIndex := AView.DataController.GetRowIndexByRecordIndex(RecIndex, true);
AView.Controller.FocusedColumnIndex := k;
Break;
end;
end; ColIndex := 0;
if Result then
Break;
end; if Result then Break;
end;
end;// if Result then
// begin
// AView.DataController.ClearSelection;
// AView.Controller.FocusedRecord.Selected := true;
// end;
end;
TcxDataControllerGroupsProtected = class (TcxDataControllerGroups);
var
AFilteredRecordIndex, AStartFilteredRecordIndex, AEndFilteredRecordIndex, AFocusedRecordIndex: Integer;
begin
Result := False;
if (ASubText = '') or (DataController.FilteredRecordCount = 0) then Exit;
ItemIndex := AItemIndex;
if DataController.IsGridMode then
Result := DataController.DoSearchInGridMode(ASubText, True, False)
else
begin
AFocusedRecordIndex := DataController.GetFocusedRecordIndex;
if AFocusedRecordIndex < 0 then
AStartFilteredRecordIndex := 0
else
AStartFilteredRecordIndex := DataController.FilteredIndexByRecordIndex[AFocusedRecordIndex];
AFilteredRecordIndex := DoSearch(AStartFilteredRecordIndex, -1, ASubText, True);
if AFilteredRecordIndex = -1 then
begin
AEndFilteredRecordIndex := AStartFilteredRecordIndex - 1;
AStartFilteredRecordIndex := 0;
AFilteredRecordIndex := DoSearch(AStartFilteredRecordIndex, AEndFilteredRecordIndex, ASubText, True);
end;
if AFilteredRecordIndex <> -1 then
begin
DoFocusedRecord(AFilteredRecordIndex);
Result := True;
end;
end;
if Result then
begin
DataController.FIncrementalSearching := True;
DataController.FIncrementalSearchText := ASubText;
DataController.Change([dccSearch]);
DataController.CheckFocusedSelected;
end;
end;这个是源码的locate函数,跟进去就不晓得是扎个回事了