Solved

How obtain first visible column in DBGrid?

Posted on 1997-12-13
1
401 Views
Last Modified: 2010-07-27
      Hey!

I want to to read what column is the first visible in a DBGrid component at any given time. With a StringGrid it's easy to obtain, with the LeftCol property, but DBGrid doesn't seem to have a similar property. Anybody know any other way?

Thanks!

Daniel, Sweden
0
Comment
Question by:Dippen
[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
1 Comment
 
LVL 8

Accepted Solution

by:
ZifNab earned 70 total points
ID: 1353547
What about this? :

procedure TForm1.Button2Click(Sender: TObject);
var
   i: Integer;

begin
 i := 0;
 while (table1.fields[i].visible = false) and (i <= table1.FieldCount-1) do inc(i);
end;

The first visible field is the first visible column.

Have fun,
c.u. ZifNab;
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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