Home > Back-end >  Cxgrid cell fuzzy query
Cxgrid cell fuzzy query

Time:09-23

CodePudding user response:

Why also requires focus remains the same? Select the back focal point can't

CodePudding user response:

The third can not, people from other questions that I get to come over

CodePudding user response:

There are an example of a master-slave table demo, you need to set up a few level, respectively, set up corresponding datasource, KEY FIELD, can

CodePudding user response:

1, input popup auxiliary box, I was using a dbgrid do auxiliary box
 procedure TfmCarInfo. LabeledEdit_AddPartChange (Sender: TObject); 
The begin
If the Trim (LabeledEdit_AddPart. Text) & lt;> "' then
The begin
ADOQuery_CodeList. Close;
ADOQuery_CodeList. SQL. The Clear;
ADOQuery_CodeList. SQL. The Add (' select * from part where wshortname like '+', '%' + LabeledEdit_AddPart. Text + '%' ");
ADOQuery_CodeList. Open;
If ADOQuery_CodeList. RecordCount<> 0 then
The begin
DBGrid_PartList. Top:=LabeledEdit_AddPart. Top + LabeledEdit_AddPart. Height;
DBGrid_PartList. Left:=LabeledEdit_AddPart. Left;
DBGrid_PartList. Visible:=true;
end;
End
The else
The begin
DBGrid_PartList. Visible:=false;
end;
end;

2, press the button, move to the secondary box
 procedure TfmCarInfo. LabeledEdit_AddPartKeyDown (Sender: TObject; Var Key Word; 
Shift: TShiftState);
The begin
If the Key=40 then
The begin
If (DBGrid_PartList. Visible) then
The begin
DBGrid_PartList. SetFocus;
end;
end;
If the key=VK_RETURN then
DBGrid_PartList. Visible:=False;
end;

Procedure TfmCarInfo. ApplicationEvents1Message (var Msg: tagMSG;
Var Handled: Boolean);
The begin
//intercept mouse the left key click, if the focus is not in the corresponding input fields and drop-down list, the hidden drop-down list
If the Msg. Message=WM_LBUTTONUP then
The begin
If (Self) ActiveControl) Name<> 'LabeledEdit_AddPart) then
If (Self) ActiveControl) Name<> 'DBGrid_PartList) then
DBGrid_PartList. Visible:=false;
end;
end;
Procedure TfmCarInfo. ApplicationEvents1ShortCut (var Msg: TWMKey;
Var Handled: Boolean);
The begin
//intercept, press the TAB key events hidden drop-down list
If (MSG) CharCode=VK_TAB) then
The begin
If the Self. The ActiveControl. Name='LabeledEdit_AddPart then
DBGrid_PartList. Visible:=false;
end;
end;

CodePudding user response:

In a pop-up window?
  • Related