解决方案 »
- 一个有关quickrep报表的问题。 急急!!!!!
- Express Quantnum Grid V3.22+Pardox 7的数据库,在Delphi 6.240里不能显示?
- ADOQuery中SQL句子问题?
- 局域网IP地址监测
- 一个关于过程定义和调用简单的问题。但是我不会。up有分!
- 请问,我打算在下拉菜单下加一排可以显示图标的按扭,
- 不知道那位大哥能帮我,我在作三层数据库时, 不能插入中文字段?
- 急急急!动态创建表格.老是提示出错.
- 好东西
- 各位大虾:MDI模式下如何获得子窗口的控件信息?又如何改变子窗口控件的属性?
- 被千万收购的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函数,跟进去就不晓得是扎个回事了