Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
3 Grid Questions
Message
From
09/07/1999 11:10:45
 
 
To
09/07/1999 05:24:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00238736
Message ID:
00239448
Views:
16
Hi Marcia
>
>I managed that bit - but how do you re-instantiate it?
>
>Add the class library that you saved the grid class to to the form controls tool bar but clicking on the >>ViewClasses button and selecting add. Locate the grid class on the tool bar and drop it on the form.
>

Sorry - I meant how do you re-instantiate it in mid application!?

The idea being that it would save all that other code I've had to do redefine the grid... I was hoping for something like 'removeobject(grid1)' followed by 'addobject(MySavedVersion of grid1)' or something similar...

>> now this worked - almost! The checkbox appeared but all blank - as though not bound to data. Yet any attempt by me to force its controlsource was rejected... <<

>Rejected? How?

here's the code I've got so far
with this.grid1.column9
.header1.caption='Paid'
* .text1.value=iif(paid,'Yes','No') &&(my feeble attempt to get it to report something)
.controlsource='balance.paid'
.readonly=.t.
.width=40
.AddObject('Check1','CheckBox')
.CurrentControl = 'Check1'
.check1.visible=.t.
.Sparse = .F.
endwith

when I tried to include, below the addobject line, ".check1.controlsource='balance.paid'"
it responded with the message "the parent won't allow you to set a control source for this object"

>Do you have the controlSource for the column set before you do the addobject?

as you can see, I do.

>
Oh, I think you also have to set .CheckBox.Visible = .T. As I recall, objects added with AddObject are not visible until you explicitly set their visible property.
>

again, as you can see, I've now modified that as well, but still no display. If its any help, what is actually on screen is an empty checkbox followed by its name (Check1) in each line of the grid!

whodathought displaying a simple 'tick' could be this much effort!

Actually even if I ignore the checkbox - the reinstated grid is not showing (as T or F) the value of the 'Paid' flag - which it is quite happily doing outside the query... Its as though column 9 is being ignored. The other 8 work fine so I'm mystified.

Harry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform