Solved

Combo box in TStringGrid?

Posted on 1997-04-12
3
453 Views
Last Modified: 2010-04-03
Is it possible have a combo box for certain columns of a TStringGrid? If not, what is another approach I can use to display a 'pick list' to the user within a TStringGrid?
0
Comment
Question by:ChrisGin
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
mheacock earned 50 total points
ID: 1335373
This is not really an 'easy' question, but I'll give it a shot.

I might put a special string in cells that would contain the pick grid, perhaps "<choose>".

When someone selected a cell with "<choose>" in it, you would unhide a combo box you have on your form and place it in the appropriate place on the grid and allow the user to choose a string.  This placing of the combo box would be a very involved procedure...doable, but difficult.

Second you would need a 2D array of TStringLists (or TLists) for the number of rows/columns in your grid...these lists would either be empty, or contain the pick lists for the appropriate cells.

Other than placing the ComboBox, this is probably the the simplest/best solution.  TStringGrid on its own will not support what you desire...you could take the TStringGrid source code and alter it to your desires to create a new TStringComboGrid component.
0
 

Author Comment

by:ChrisGin
ID: 1335374
Hmm, that's a pity - I thought there might be an 'easy' way since  it is used extensively in Delphi's Object Inspector. Do you know how the Object Inspector was created?
0
 
LVL 3

Expert Comment

by:mheacock
ID: 1335375
I don't think the Object Inspector is a string grid.  It behaves and reacts differently to mouse clicks and selections.  It looks like a specially designed component.
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

Suggested Solutions

Title # Comments Views Activity
Filemaker 14 vs Delphi Embarcadero 7 186
Need Delphi function to get Youtube video title 5 227
loading dll from external path 1 211
delphi parse string to params 3 100
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…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

18 Experts available now in Live!

Get 1:1 Help Now