Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last node doesn't displayed!!!

Status
Not open for further replies.

midou

Programmer
Oct 20, 2002
24
FR
Hi!
I have treeview and 2 command buttons, the first one add nodes and the other delete nodes.when I add nodes, they are displayed in treeveiw and in the table except that the last node which is not displayed after leaving the form and carrying out again,all nodes added except the last one which is non-existent neither in treeview nor in the table.
(Notes that I refresh the treeview)
many thanks for your attention et and your help.
 
Hi!
What is tablebuffering?
Yes, I save data in my table, I see them in table and in my treeview but the last data it doesn't displayed in treeview and in table only the last one.
 
So let me get this clear,

You add a node by addding a record to your table which is the base of your treeviews data. When added, you refresh your treeview and the new node is added.
The same goes for deleting records/nodes.

Is this true ?

Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
Hi!
Yes this is true, but I tell u only the last record isn't add neither to the table nor to the treeview but I see it when I added it one the firste time, when I leave my form and carry out it, I don't found the last record which I added it, but for deleting node it's remove to treeview but not to the table.I hope that this is clear for u now.
Many thanks for your attention.
 
Could you place the code that adds and deletes the node and the record to the table ?

This might help giving us some insight into the problem. Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
-->this deleting code:
[If !IsNull(loThisNode)
lcMessage = "Êtes vous sûr de vouloir supprimer ce noeud (" + loThisNode.Text + ") du TreeView? "
lckey = ThisForm.txtcNode.Value
With THISFORM.oleTreeView.nodes
Select tree
Set order to xsitem
Seek str(loThisNode.Index)
delete for sitem = lckey
Endwith]
-->this adding code:
[If ThisForm.txtnRelative_Index.Value = 0 && indicates no parent
loNewNode = ThisForm.oTreeView.Nodes.Add(,,AllTrim(Upper(ThisForm.txtcKey.Value)),AllTrim(ThisForm.txtcText.Value),3,4)

Select tree
set order to xsitem
Insert into tree (item,nom,sitem,profil);
values (" ",AllTrim(ThisForm.txtcText.Value),AllTrim(Upper(ThisForm.txtcKey.Value)),ThisForm.oParentForm.grid1.column1.text1.value)
Else
loNewNode = ThisForm.oTreeView.Nodes.Add(ThisForm.txtcRelative_Key.Value,(ThisForm.cboRelationship.Value-1),AllTrim(Upper(ThisForm.txtcKey.Value)),AllTrim(ThisForm.txtcText.Value),3,4)
select tree
set order to xsitem
Insert into tree (item,nom,sitem,profil);
values (ThisForm.txtcRelative_Key.Value,AllTrim(ThisForm.txtcText.Value),AllTrim(Upper(ThisForm.txtcKey.Value)),ThisForm.oParentForm.grid1.column1.text1.value)
thisform.refresh
Endif]
 
See thread:

thread184-140613

Note: if you locate records, you should always check if the location was successfull. Assuning that it was successfull will lead to often untracable problems and will cost you much time.

See chapter 6.0 (defensive programming) of my favourite book Code Complete by Steve McConnell.

Good luck and let me know if it helped solve your problem.

Weedz (Wietze Veld)
My private project:CrownBase source code can be downloaded !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top