Solved

Sending Grid Column Titles to Clipboard

Posted on 1999-01-09
2
178 Views
Last Modified: 2010-04-04
How do you access the dbgrid column title text to send to the clipboard? I can send the dbgrid contents but not the column headings.
0
Comment
Question by:evansj
2 Comments
 
LVL 1

Accepted Solution

by:
adeng earned 50 total points
ID: 1355505
1. Procedure to copy all DBGrid title to Clipboard :

procedure TForm1.Button1Click(Sender: TObject);
var
     I: Integer;
begin
     with DBGrid1 do
     begin
          I := 0;
          ClipBoard.Clear;
          while I < FieldCount do
          begin
               Clipboard.AsText := Clipboard.AsText +
               Columns[I].Title.CAPTION+ ', ';
               inc(I);
          end;
     end;
end;

2. Procedure to copy DBGrid title of the active cell to Clipboard :

procedure TForm1.Button2Click(Sender: TObject);
begin
     with DBGrid1 do
          Clipboard.AsText := Columns[SelectedIndex].Title.Caption;
end;

0
 

Author Comment

by:evansj
ID: 1355506
I didn't need the code snippet, I just needed the property. Thanks lots.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

760 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

19 Experts available now in Live!

Get 1:1 Help Now