Solved

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

Posted on 2003-10-24
4
1,151 Views
Last Modified: 2007-12-19
The dxDBGrid is in Browse state,but I want to copy the contents of a cell to clipboard.

How can I do?
0
Comment
Question by:SingBabys
4 Comments
 

Author Comment

by:SingBabys
Comment Utility
I'm waiting for the answer.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
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 ;-)
0
 
LVL 4

Accepted Solution

by:
nestorua earned 250 total points
Comment Utility
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.
0
 
LVL 12

Expert Comment

by:Lee_Nover
Comment Utility
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
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now