Re: Topgrid combos
- From: MikeR <nf4lNoSpam@xxxxxxxxx>
- Date: Fri, 17 Mar 2006 12:08:23 -0500
Martijn Tonies wrote:
The combo for the cell.Aha! That's what I couldn't come up with.
The CellCombo property of the grid refers to a TtsCombo for
that cell only.
True. But if I had found it I wouldn't be asking the question, now would I?
value,object;Yes I did. Twice. I see properties and methods. What I don't see is howThat's an event, not a property.This one? Which of the 2 columns am I looking at?3. Locate a value, and make it the displayed value.There are properties to do this automatically if you have a value
for the cell.
tsGrid1ComboLCompareValue(Sender: TObject; ComboString,
CurrentCellString: String; Len: Integer; var CompareRes: Integer);
Did you read the Help on the TopGrid yet?
to access any of them. This what you're talking about?
TtsComboLCompareValueEvent = procedure (Sender: TObject; ComboString,
CurrentCellString: string; Len: Integer; var CompareRes: Integer) of
property OnComboLCompareValue: TtsComboLCompareValueEvent;
Applies to
TtsGrid.
Description
Use the OnComboLCompareValue event if you want to supply your own
comparison routine for locating the current cell's value in the combo
box's drop down list. The CurrentCellString is the current cell's
handlerthe ComboString is the value from the combo drop down. The eventAnd which of the 400 combos in my grid will this return a value for? Youshould compare the ComboString with the CurrentCellString for the firstUse AutoSearch = True - that should do the trick if the combo is filled.
Len characters.
The event is used to compare the current cell's value to a value in the
drop down list when the AutoSearch property of the combo box is turned
on and the CompareType property is set to stOwn. ComboString is the
have provided *NO* way to refer to an individual combo. Please keep in
mind I'm trying to do this programatically, NOT by clicking on a combo.
See above. You can read the help as good as I can.
Yep.
The AutoSearch property is a property of the combo.
Variant);than typing in the values 1 by 1 in the designer.4. It would be nice to be able to load the combos in some other wayThere's an event that you can use to fill the combo from code.Correct event?
tsGrid1ComboCellLoaded(Sender: TObject;
Combo: TtsComboGrid; DataCol, DataRow: Integer; var Value:
Huh? I don't want to do it on a click. I want to do it programmaticaly.This even will be fired whenever a combo drops down, so you canEhm, there's also OnComboDropDown or somethign like that.OK. From help on OnComboDropDown:
TtsComboCellEvent = procedure (Sender: TObject; Combo: TtsComboGrid;
DataCol, DataRow: Longint) of object;
property OnComboDropDown: TtsComboCellEvent;
So how would I use this to store the string 'Mikey' in the combo at co1
1, row 1 of the grid?
use it to put values in the drop down grid of the combo.
The Combo param is already filled with a valid ComboGrid instance.
Did you read what I wrote?
OK. I was wanting to fill it in the OnCreate for the form, but this will work.
You can fill your combo programmatically as soon as a user
requests the combo to be opened.
You do this by using that particular event.
I'm sorry if you're offended. I think you are the type who wants the student to work for their answers, and I understand and endorse that point of view myself. But if you offer yourself in this arena, you have to be prepared to accomodate the slower ones if you wish to be a good teacher.
As written in the Help:
"OnComboDropDown occurs just before the combo box appears."
"Write an OnComboDropDown event handler when you want to initialize the
combo box for a cell."
What more do you want? Besides complaining against me while I'm offering
free help
Martijn -
Experiment a bit, you'll find it ;)I would, if only I could find the starting point. Which I think is:
How do I refer to a particular combo?
Read the help, I've given you everything you need.
I appreciate the time you've put into this, but it hasn't gotten me any
closer to a solution. Prehaps I haven't expressed my issues clearly
enough, but I'm at a loss as to how to do it better. Bottom line, I
can't figure out how to get at the combo in code. For instance for a
TCombobox there is a name property. So I can say MyCombo.text, or
MyCombo.Itemindex, or MyCombo.Additem('Mikey'). For a Ttsgrid there is a
name property. So I can refer to a cell like this: MyGrid[1,1] :=
'mikey'. But for a combo in a Ttsgrid I can't say MyCombo.whatever.
A code snippet would be great.
The CellCombo property does what you need!
I think I have what I need now. I really do appreciate your aid. Happy programming!!
Mike
.
- Follow-Ups:
- Re: Topgrid combos
- From: Martijn Tonies
- Re: Topgrid combos
- References:
- Topgrid combos
- From: MikeR
- Re: Topgrid combos
- From: Martijn Tonies
- Re: Topgrid combos
- From: MikeR
- Re: Topgrid combos
- From: Martijn Tonies
- Re: Topgrid combos
- From: MikeR
- Re: Topgrid combos
- From: Martijn Tonies
- Re: Topgrid combos
- From: MikeR
- Re: Topgrid combos
- From: Martijn Tonies
- Topgrid combos
- Prev by Date: Re: recomendations for showing and AVI file please
- Next by Date: JVCL nominated at the SourceForge.net Community Choice Awards: Show your support
- Previous by thread: Re: Topgrid combos
- Next by thread: Re: Topgrid combos
- Index(es):
Relevant Pages
|