Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sending Grid Column Titles to Clipboard

Posted on 1999-01-09
2
Medium Priority
?
188 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 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