I have a an array populated from a table [tablename(cid c(8), cdesc(100))]
and bind it into a combobox as the rowsource. The problem that I have is
the length of the display when using the combo box is showing the whole 100
characters even I only have a maximum 30 characters from my table. Is there
anyway i can trim the display using the method above?

Thanks.

apa

Re: Trimming combobox length display by Bernhard

Bernhard
Tue Oct 17 10:21:57 CDT 2006

Hi apa,

> I have a an array populated from a table [tablename(cid c(8), cdesc(100))]
> and bind it into a combobox as the rowsource. The problem that I have is
> the length of the display when using the combo box is showing the whole 100
> characters even I only have a maximum 30 characters from my table. Is there
> anyway i can trim the display using the method above?
Use VarChar for the cdesc field.
Or (in VFP 9) SELECT cid, cast(trim(cdesc) AS varchar(100)) INTO ARRAY laArray
Or use a loop to trim the array elements
Or fill the combobox (using AddItem) in a loop where you trim the cDesc field

Regards
Bernhard Sander

Re: Trimming combobox length display by tim_witort

tim_witort
Tue Oct 17 12:45:38 CDT 2006

apa seemed to utter in news:uTCh6Zf8GHA.4632@TK2MSFTNGP02.phx.gbl:

> I have a an array populated from a table [tablename(cid c(8),
> cdesc(100))] and bind it into a combobox as the rowsource. The problem
> that I have is the length of the display when using the combo box is
> showing the whole 100 characters even I only have a maximum 30
> characters from my table. Is there anyway i can trim the display using
> the method above?

If you're asking how you can control the width of the combo's
dropdown list, then that can be done by using the ColumnWidths
property. Set ColumnCount to 2, ColumnLines to .F., then
ColumnWidths to 100,0. Then tweak the first number of the
ColumnWidths setting until the dropdown is the width you want.

-- TRW
_______________________________________
t i m
a t
w i t o r t d o t c o m
_______________________________________