How can I Copy the content in a cell of dxDBGrid to clipboard?

SingBabys
SingBabys used Ask the Experts™
on
The dxDBGrid is in Browse state,but I want to copy the contents of a cell to clipboard.

How can I do?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
I'm waiting for the answer.
Top Expert 2004

Commented:
usual u use directly the dataset which is assigned to the grid for this

a sceleton

implementation
{$R *.DFM}

uses Clipbrd;
var AClipBoard : TClipBoard;

procedure TForm1.Button1Click(Sender: TObject);
begin
  AClipBoard.AsText := Dataset.FieldByName('FieldNameYouWant').AsString;
end;

initialization
  AClipBoard := TClipBoard.Create;
finalization
  AClipBoard.Free;
end.

meikl ;-)
Commented:
HI,
Do the following:
procedure TForm1.DBGrid1CellClick(Column: TColumn);
begin
  AClipBoard.AsText:=Column.Field.AsString;
end;
Here AClipBoard is a variable of type TClipBoard
(If you read the previous comment you know how to create and free it).
Sincerely,
Nestorua.
ClipBoard is a global object and doesn't need to be created
about dxDBGrid .. forgot it's methods and properties .. been using cxGrid (ver 4+) since it came out

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial