Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enabled / disabled checkbox in a grid with only 1 contr
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01505221
Message ID:
01505230
Vues:
40
>>Hi everybody,
>>
>>I'm wondering if there is a simple solution of using just one control and yet controlling checkbox enabled status in a grid.
>>
>>In the first column of the grid I have a combobox. Depending on the selected value, I want to adjust checkboxes in my grid to be enabled /disabled for this record. However, when I set them in the combo's valid event, it seems like all checkboxes get re-set, not the current row only.
>>
>>Thanks a lot in advance for ideas.
>
>Have you checked the Column.Sparse property in the column of the checkbox, it should be .F.

Sparse is .f. for these columns.

Here is my current code in the combo's valid method
this.Value = this.Value 
thisform.ChangeOperator()
And the ChangeOperator code has
thisform.cntOperatorButtons.cmdEdit.Enabled = not EMPTY(csrOperators.op_code)
WITH thisform.grdOperators 
     .colEmail.my_checkbox1.enabled = not EMPTY(csrOperators.Email)   
     .colNetSend.my_checkbox1.enabled = not EMPTY(csrOperators.NetSend)   
     
     .colPager.my_checkbox1.enabled = .f. && not EMPTY(csrOperators.Pager)   
     .colSMS.my_checkbox1.enabled = .f. && not EMPTY(csrOperators.SMS)   
     .colTwitter.my_checkbox1.enabled = .f. && not EMPTY(csrOperators.Twitter)   
ENDWITH
I think this code is not what I want as the effect is that all checkboxes become disabled. I was thinking of trying some complex solution based on refresh, but I guess I will go with the commonly accepted solution of two controls in each column instead.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform