Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview - Checked only with a condition
Message
 
 
À
08/12/2008 08:55:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01365937
Message ID:
01366180
Vues:
22
This message has been marked as the solution to the initial question of the thread.
You cannot uncheck checkbox from within of a treeview. See Treeview - programmatically UNcheck a mouse-checked node Message #731673

Also there's no need to make code more complicated that it should be.
* This convoluted expression
toNode.Checked = !toNode.Checked=.t.
* Is the same as simple
toNode.Checked = !toNode.Checked
	Select mytableA
	Set Order To client_id
	Seek toNode.Tag
	If  Found() ...
* can be shortened to
	If SEEK(toNode.Tag, "mytableA", "client_id") ...
<pre>

>
>at mytreeview.nodecheck method I'm trying to:<pre>*** ActiveX Control Event ***
>Lparameters toNode
>This.SelectedItem = toNode
>If  Empty(toNode.Tag)
>	Thisform.actionrecursive_in_child( toNode )
>Else
>	Select mytableA
>	Set Order To client_id
>	Seek toNode.Tag
>	If  Found() and !Empty(clients.email)
>	    toNode.Checked = !toNode.Checked=.t. && seems doing fine
>	Else
>        	    toNode.Checked = .f.   && here is the point... uncheck fine here.
>	    *This.SelectedItem.Checked = .f.
>	*   ?? CHR(07)
>	*   ThisForm.Container1.Text10.SetFocus()
>	*	NODEFAULT 
>                *	RETURN .f.
>	Endif
>Endif
>
>
>My goal is about to doesn't allow the user check items with empty field of client's email...
>
>So, if I Follow this code with debug... it run and does fine what I'm trying to do... But after notecheck method it becomes checked again with no logic reason.
>
>Is there a way, on treeview, to allow check only in some sort of data??
>
>TIATOALL
>
>Claudio
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform