Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox in grid with listindex = 1 ??????
Message
De
12/03/2004 02:26:59
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Allemagne
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Combobox in grid with listindex = 1 ??????
Divers
Thread ID:
00885490
Message ID:
00885490
Vues:
59
Hallo everybody

I have a form with a search field, a grid, a 'new-command'
At the init of my form i define a cursor 'mycursor' depending on tableinformations
and i customize the grid depending on tableinformations
The currentcontrol of some columns is set to gridcombo and rowsourcetyp, rowsource,columncount are set

At keypress of the search field i do:
thisform.grid1.recordsource = " "
sqlexec(connection,"select * from xxx where ...",mycursor)
thisform.grid1.recordsource = mycursor

At click of the new command i do
thisform.grid1.recordsource = " "
SELECT mycursor
APPEND BLANK
*default values
replace angelegt with DATE()
replace uhrzeit with TIME()
replace benutzer with p_benutzer

FOR i = 1 TO thisform.grid1.ColumnCount
l_obj = "thisform.grid1.column" +ALLTRIM(STR(i)) + ".currentcontrol"
l_objwert = &l_obj
IF UPPER(l_objwert) = "GRIDCOMBO"
l_combo = "thisform.grid1.column" +ALLTRIM(STR(i)) + ".gridcombo"
WITH &l_combo
.listindex = 1
ENDWITH
ENDIF
ENDFOR
thisform.grid1.recordsource = mycursor
thisform.grid1.setfocus

Now my problem:
If the user has searched for some records and clicks the new command everything is OK !
Blank record in the grid with some default values, all comboboxes show the first value !!!
If the user clicks the new command without searching first there is a blank record
with default values in the grid but all comboboxes are empty ??????
They work but you have to select a value from the list ??
Whats wrong with my listindex = 1 ? Why does it only works if there are records in the grid ??

Any help welcomed
Best regards
Albert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform