Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control is Read Only
Message
De
18/01/2002 02:33:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/01/2002 15:26:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00606201
Message ID:
00606572
Vues:
28
>>
>>In your code you were using a grid that's already on form and directly assigning recordsource. When you do that original format is preserved. I suspect columns readonly property might be .t. and it overrides text1.readonly.
>>
>>Try like this :
>>
>>
with .grdForms
>> .Recordsource = ''
>> .Columncount = -1
>> .Recordsource = 'showforms'
>> *...  && Temporarily comment this part
>>endwith
Cetin
>
>Cetin:
>
>The try above didn't work, but your comment about using the grid that's already on form set me on a different tack that has gotten it working. I just don't understand why what I did makes a difference.
>
>When I first built the grid I was using a different recorsource (a read-only cursor). When I changed to using the table, I went into each column and reset the control source to default. All the ReadOnly properties were still at default (.F.).
>
>I opened the proper table with an alias of SHOWFORMS and then went into the Grid Builder. I didn't make any changes there and clicked on OK.
>
>The next time I ran the code, the grid was not ReadOnly.
>
>There were some formatting problems where every line of the grid showed the same record. If you moved into the row, the values changed to reflect the proper record in the table. I fixed that by SELECT(ing) SHOWFORMS before I set the grid's RecordSource.
>
>Any enlightenment as to why rebuilding the grid would remove the ReadOnly status would be appreciated.
>
>At any rate, it's now working and I very much appreciate your help in making that happen.
>
>........Rich

Rich,
Grid rebuilding (partially and totally) is a long subject. Basically a grid can't be w/o a recordsource when there is one it can bind around. If you don't set one it 'grabs' the selected alias as the recordsource. Columns automatically bind fields starting from first and if fieldcount is less than columncount remaining columns start to fill cycling from first field etc. Also some properties are inherited to child elements (column readonly, controlsource etc inherit hierarchically to its text1-or another control). By default column and its controls are bound, IOW if column is readonly or have controlsource x then text1 is readonly and has controlsourceX even if you set it to something like controlsourceY. When recordsource is readonly it atomatically overrides all column, text1 settings. Kind of hierarchy :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform