Home > Back-end >  After about DBGridEh: choose set line how to copy the value of the current unit?
After about DBGridEh: choose set line how to copy the value of the current unit?

Time:10-14

About DBGridEh:

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 events

CodePudding user response:

If there is no alternative direct copy good
Procedure TfMain. DBGridEh1CellClick (Column: TColumnEh);
The begin
ClipBoard. AsText:=Column. DisplayText;
end;

When need
Change:=ClipBoard. AsText; Is OK
  • Related