Solved

Sending Grid Column Titles to Clipboard

Posted on 1999-01-09
2
179 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
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 …

929 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

9 Experts available now in Live!

Get 1:1 Help Now