Solved

Sending Grid Column Titles to Clipboard

Posted on 1999-01-09
2
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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