Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enabled / disabled checkbox in a grid with only 1 contr
Message
 
 
To
28/03/2011 12:24:15
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01505221
Message ID:
01505230
Views:
39
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform