Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid doesn't display table data after adding a new text
Message
De
15/05/2003 04:07:53
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00788524
Message ID:
00788548
Vues:
28
>I have a grid that is dynamically created to the fields in the table that is passed. The code for it is below.
>
>The problem code that I have is prefixed with asterisks. If I add a new textbox class to a column and set the properties of the column, the columns don't display data but the scroll bars of the grid does show that there are records. If I leave the sparse property as true, then the grid does display data but the selected cell doesn't. The textbox class that I am adding has code in the dblclick function only, nothing fancy.
>
>Can someone please help me with this problem as I am pretty sure that it is something small.
>
>Thanks in advance,
>Jeun
>
>for pri_cnt = 1 to alen(arr_srchstruc,1)
> if inlist(alltrim(upper(arr_srchstruc(pri_cnt,2))),"M")
> pri_negcnt = pri_negcnt + 1
> loop
> endif
> thisform.grd_seqsearch.addcolumn()
>* pri_oldcontrol = thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).currentcontrol
>* pri_macro = space(0)
>* thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).sparse = .f.
>* thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).addobject('SelText'+alltrim(str(pri_cnt-pri_negcnt)),'default_textbox_seqsearch_select')
>* thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).currentcontrol = 'SelText'+alltrim(str(pri_cnt-pri_negcnt))
>* thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).dynamiccurrentcontrol = "='SelText"+alltrim(str(pri_cnt-pri_negcnt))+"'"
>* thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).removeobject(pri_oldcontrol)
>* pri_macro = "thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt)."+'SelText'+alltrim(str(pri_cnt-pri_negcnt))+".select_method"
>* &pri_macro = "ThisForm.release"
> if not empty(m.sysid)
> select field
> goto top
> locate for table_sysid = m.sysid and alltrim(upper(field_name)) == alltrim(upper(arr_srchstruc(pri_cnt,1)))
> if found()
> scatter fields caption memvar
> else
> scatter fields caption memvar blank
> endif
> else
> private m.caption
> m.caption = arr_srchstruc(pri_cnt,1)
> endif
> if len(alltrim(upper(m.caption))) < (arr_srchstruc(pri_cnt,3)+arr_srchstruc(pri_cnt,4))
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).width = (arr_srchstruc(pri_cnt,3)+arr_srchstruc(pri_cnt,4))*8
> else
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).width = len(alltrim(upper(m.caption)))*8
> endif
> if alltrim(upper(arr_srchstruc(pri_cnt,2))) = "L"
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).controlsource = "iif("+par_table+"."+alltrim(arr_srchstruc(pri_cnt,1))+",'Yes','No')"
> else
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).controlsource = par_table+"."+alltrim(arr_srchstruc(pri_cnt,1))
> endif
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).readonly = .t.
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).header1.caption = alltrim(m.caption)
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).header1.fontname = "MS Sans Serif"
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).header1.fontsize = 8
> thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).header1.alignment = 2
>endfor
>thisform.grd_seqsearch.recordsource = par_table
>thisform.grd_seqsearch.refresh

Dear Jeun,

Perhaps qualify the field and set the ControlSource for the TextBox as well ...

thisform.grd_seqsearch.columns(pri_cnt-pri_negcnt).Text1.controlsource = par_table+"."+alltrim(arr_srchstruc(pri_cnt,1))

maybe the current open table has fields of similar name(s) with the intended tables.
Kenneth.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform