Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CGridlist
Message
From
08/05/1999 13:05:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
CGridlist
Miscellaneous
Thread ID:
00216411
Message ID:
00216411
Views:
89
I found a small bug in the When() method of cGridlist, located in kcustctl.vcx. Here's the code:

*---------------------------------------
*--- Set the column controls' BackColor,
*--- ForeColor and SelectedBackColor
*---------------------------------------
FOR lnColumn = 1 TO This.ColumnCount
loControl = EVAL("This.columns[lncolumn]." + This.Columns[lnColumn].CurrentControl)
loControl.BackColor = This.nSelectedBackColor
loControl.ForeColor = This.nSelectedForeColor
loControl.SelectedBackColor = This.nSelectedBackColor
ENDFOR

The problem with the above code is that it assumes that you the currentcontrol supports the SelectedBackColor property. If you are using a checkbox, you will get an error. Currently, there are four controls that support this property: textbox, combobox, editbox and spinner.

I suggest testing the parentclass of loControl before attempting to set the SelectedBackcolor. This can be done with a custom method or simply an if statement. I used a custom method, but Kevin has the final decision on how the framework should deal with this minor problem. Thanks all!
Next
Reply
Map
View

Click here to load this message in the networking platform