Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Dynamic Caption
Message
From
10/03/2006 11:39:04
Luis Navas
Independent Consultant
Auckland, New Zealand
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01103071
Message ID:
01103148
Views:
16
Hi Craig, as a matter of fact I did it to, I read your blog a lot and now its working but with this code:
Local lnRow As Integer, lcRow As String
lnRow=Recno()
lcRow="_"+Alltrim(Str(lnRow))
If !PemStatus(This.Parent.Parent.Parent,lcRow,5)
	This.Caption="+"
Else
	This.Caption="-"
EndIf
Return This.BackStyle
The problem I see here, it's when the table is not in natural order, what will I have to do?

Thanks

Luis


>>Hi to all.
>>
>>I need your help with this:
>>
>>I have a grid, I added one column with a commandbutton, sparse =.F., this column is not bound to data, I want to show diferent captions in the commandbutton depending if an object exists in the parent container of the grid. I also try the dynamic current control property to change the current object of the column but with no luck. Any help will be appreciated
>>
>>Thanks in advance.
>>
>>Luis Navas
>
>Create a subclass of your button and place it in a container. Then add the backstyle_access method for the backstyle property of the container. In that backstyle_access method then do your check for criteria that effects the contained button's caption. Heck you might even be able to get away with using just a button subclass that has a backcolor_access method and forego the container, but I haven't tried that. I do know that the backstyle_access will fire on the container as each visible row is rendered in the grid. So, in the access method you would have something like...
>
>this.button1.caption = ICASE(blah, blah, blah)
>
>Now, somewhere here there has to be a relation to the record otherwise all the button captions will change. What I mean is that you don't have to actually have the button column bound to anything but your ICASE or whatever is going to have to take the current record into consideration... such as some other field in the record that is the name of the control that is being checked for or whatever.
I never forget a face, but in your case I will make an exception :-)
Previous
Reply
Map
View

Click here to load this message in the networking platform