After set line selection, how to obtain current cell value?
Cell without focus, cannot copy
The original DBGridEh1. SelectedField and DBGridEh1. SelectedIndex has been positioned in the first column
CodePudding user response:
Procedure TfMain. DBGridEh1CellClick (Column: TColumnEh);
The begin
ShowMessage (Column. DisplayText);
end;
CodePudding user response:
Upstairs said is very good, learning,CodePudding user response:
TKS!Excuse me,
Under the condition of same line selected, right-click popup menu in the cell - & gt;" How to realize the function of copy the "cell?
Then how to obtain the value of the cell?
CodePudding user response:
Now that you've got the current field value, put a pop-up menu operation clipboard,USES Clipbrd;
ClipBoard. AsText:=Column. DisplayText;//send a field to clipboard
Caption:=Clipboard. AsText;//take a clipboard
To apply a bit more thoughtful, here just method,
CodePudding user response:
The mouse "right click" popup menu does not trigger DBGridEh1CellClick eventsCodePudding user response:
If there is no alternative direct copy goodProcedure TfMain. DBGridEh1CellClick (Column: TColumnEh);
The begin
ClipBoard. AsText:=Column. DisplayText;
end;
When need
Change:=ClipBoard. AsText; Is OK