DBLookUpComboBox ListSource does not initially show current value. The text field is empty until selected from list.

Hello.

I use only the listsource part of this component to select from a table.
The challenge is that the form comes up with the component blank.
I want it to show the current post field.

Really I have tried a lot of things to make it do this, to no avail.
I can't manipulate the Text property as it is read only.
Moving the source table by code and MyDBLookUpCombo.Refresh does not
solve the problem.

The component force me to manually select it to make the item show up.

After fiddeling around with the properties and desperate code
solutions, I give up and ask:

How can I get this thing show up with the current post in the text
field *before* selected by mouse?

Thanks in advance.

:)
Kai Inge
1
Kai
8/11/2013 9:57:23 AM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

11 Replies
4101 Views

Similar Articles

[PageSpeed] 34

Kai Inge Buseth wrote:

> Hello.
> 
> I use only the listsource part of this component to select from a
> table.  The challenge is that the form comes up with the component
> blank.  I want it to show the current post field.
> 
> Really I have tried a lot of things to make it do this, to no avail.
> I can't manipulate the Text property as it is read only.
> Moving the source table by code and MyDBLookUpCombo.Refresh does not
> solve the problem.
> 
> The component force me to manually select it to make the item show up.
> 
> After fiddeling around with the properties and desperate code
> solutions, I give up and ask:
> 
> How can I get this thing show up with the current post in the text
> field before selected by mouse?

Set the KeyValue property to the key of the list item you want to
display.


-- 
Peter Below (TeamB)
0
Peter
8/11/2013 11:35:09 AM
Peter Below wrote:

> Kai Inge Buseth wrote:
> 
> > Hello.
> > 
> > I use only the listsource part of this component to select from a
> > table.  The challenge is that the form comes up with the component
> > blank.  I want it to show the current post field.
> > 
> > Really I have tried a lot of things to make it do this, to no avail.
> > I can't manipulate the Text property as it is read only.
> > Moving the source table by code and MyDBLookUpCombo.Refresh does not
> > solve the problem.
> > 
> > The component force me to manually select it to make the item show
> > up.
> > 
> > After fiddeling around with the properties and desperate code
> > solutions, I give up and ask:
> > 
> > How can I get this thing show up with the current post in the text
> > field before selected by mouse?
> 
> Set the KeyValue property to the key of the list item you want to
> display.

Thank you very much.
So simple and yet so difficult to find.
This 'hidden' property should be among the regular properties shown in
object inspector, since most of us want the component to show up with
an initial value, I believe.
Now I will store the solution in my HOW TO database, since next time
needed I will have forgotten all about it. :-)
Thanks again.

:)
Kai Inge
0
Kai
8/11/2013 12:39:11 PM
Kai Inge Buseth wrote:

> This 'hidden' property should be among the regular properties shown in
> object inspector, since most of us want the component to show up with
> an initial value, I believe.

But there is little point to setting the initial value *at design
time*, isn't there? That would require published scope for the
property. It is public now and that is suitable for most purposes, IMO.

-- 
Peter Below (TeamB)
0
Peter
8/11/2013 3:17:55 PM
Peter Below wrote:

> Kai Inge Buseth wrote:
> 
> > This 'hidden' property should be among the regular properties shown
> > in object inspector, since most of us want the component to show up
> > with an initial value, I believe.
> 
> But there is little point to setting the initial value *at design
> time*, isn't there? That would require published scope for the
> property. It is public now and that is suitable for most purposes,
> IMO.


The challenge is to 'know' about the property when you need it, but of
course we can ask :-)
Setting the value at design time or at run time is the same matter, if
you don't know where to set it,
but now I can add KeyValue to Text and Caption that I knew before.

Thanks also for showing the difference of published and public scope.
This practical example is easier to understand, since I'm not at the
level of building components yet.

:)
Kai Inge
0
Kai
8/11/2013 4:37:17 PM
Kai Inge Buseth wrote:

> Peter Below wrote:
> 
> > Kai Inge Buseth wrote:
> > 
> > > This 'hidden' property should be among the regular properties
> > > shown in object inspector, since most of us want the component to
> > > show up with an initial value, I believe.
> > 
> > But there is little point to setting the initial value *at design
> > time*, isn't there? That would require published scope for the
> > property. It is public now and that is suitable for most purposes,
> > IMO.
> 
> 
> The challenge is to 'know' about the property when you need it, but of
> course we can ask :-)

That is what the online help is for, you know. If you are working with
an unfamiliar class it is always a good idea to check the help for it
to see what properties and methods it offers...


-- 
Peter Below (TeamB)
0
Peter
8/12/2013 8:32:37 AM
Peter Below wrote:

> Kai Inge Buseth wrote:
> 
> > Peter Below wrote:
> > 
> > > Kai Inge Buseth wrote:
> > > 
> > > > This 'hidden' property should be among the regular properties
> > > > shown in object inspector, since most of us want the component
> > > > to show up with an initial value, I believe.
> > > 
> > > But there is little point to setting the initial value *at design
> > > time*, isn't there? That would require published scope for the
> > > property. It is public now and that is suitable for most purposes,
> > > IMO.
> > 
> > 
> > The challenge is to 'know' about the property when you need it, but
> > of course we can ask :-)
> 
> That is what the online help is for, you know. If you are working with
> an unfamiliar class it is always a good idea to check the help for it
> to see what properties and methods it offers...

You are right, I should have thought of that myself.
Still I'm thankful to have you newsgroup guys around.
Thanks.

:)
Kai Inge
0
Kai
8/15/2013 6:09:59 AM
My DBLookupComboBox is linked fine.. it points to the right item in the drop down box.. saves to my DB. Everything is great.. 
but no matter what I do, it will not show an initial value as text.. If I select a value, text works fine.. I have tried everything to make my text show up.. .. but unless I select it, it wont show up as text. Ive tried everything.. refreshing, Setting the key value etc.. 
Any more ideas? I am using KBMMemtable as my query..

 


> But there is little point to setting the initial value *at design
> time*, isn't there? That would require published scope for the
> property. It is public now and that is suitable for most purposes, IMO.
> 
> -- 
> Peter Below (TeamB)

Edited by: Gordon Hamm on Jul 4, 2014 1:21 PM
0
Gordon
7/4/2014 8:23:43 PM
Gordon,

| Any more ideas? I am using KBMMemtable as my query..

This may sound like a dumb question, but,...  Have you set the Field
Property?


-- 

   Q 

07/04/2014 17:04:46

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
7/5/2014 12:05:49 AM
Quentin Correll wrote:

> 
> This may sound like a dumb question, but,...  Have you set the Field
> Property?

There are no dumb questions....Only dumb answers....;-)
0
Ian
7/5/2014 3:34:19 AM
W dniu 2014-07-05 05:34, Ian Branch pisze:
>
> There are no dumb questions....Only dumb answers....;-)
>
"So, if I stood on the rails and catch the wire above - will I ride like 
a train?"

:-)
0
Marek
7/5/2014 6:25:57 AM
Ian,

| |  This may sound like a dumb question, but,...  Have you set the
| | Field  Property?
| 
| There are no dumb questions....Only dumb answers....;-)

  ;-)  


-- 

   Q 

07/05/2014 09:55:10

1.19.1.372  [Q'sBrokenToolBar] [Running on TQ]
0
Quentin
7/5/2014 4:55:29 PM
Reply: