In my form i have a TreeView control that holds a large number of nodes. When i want to update this contol i have to clear all the nodes and refresh it with the new ones but my problem is that it does not reopen the last selected node. I have tried (before updating) storing the Selected node in a temp node variable, then after update doing this, tv_database->SelectedNode = selectedno;
but this either cause an exception when no node was selected or it doesnt affect the current selected node at all.
The only method of updating the treeview i have found is by performing these few lines:
//Remove all current nodes
database->Nodes->Clear();
tv_database->BeginUpdate();
//Add Some nodes...
tv_database->Nodes->Add(newnode);
//End the update
tv_database->EndUpdate();
is there any method that only updates the text on the nodes, doing something like
tv_database->->SelectedNode->Text = "new text"; wont update the text as the conrol isnt re-drawn, is there anymethod of doing this so as not to clear all the current nodes and just updating the text on them all?
sorry if i have explained this badly
but this either cause an exception when no node was selected or it doesnt affect the current selected node at all.
The only method of updating the treeview i have found is by performing these few lines:
//Remove all current nodes
database->Nodes->Clear();
tv_database->BeginUpdate();
//Add Some nodes...
tv_database->Nodes->Add(newnode);
//End the update
tv_database->EndUpdate();
is there any method that only updates the text on the nodes, doing something like
tv_database->->SelectedNode->Text = "new text"; wont update the text as the conrol isnt re-drawn, is there anymethod of doing this so as not to clear all the current nodes and just updating the text on them all?
sorry if i have explained this badly