or
I wish to add a key or a tag with each node (db record id) so when the user selects the node, I can retrieve the key or tag and go query the database.
Suggestions on how to store the key during node creation(node.add) and retrieval would be helpful
private
void
OnDirExpandedChanged(
object
sender, RadTreeViewEventArgs e)
{
if
(e.Node.Expanded)
{
if
(e.Node.FirstNode.Name ==
"____dummy____"
)
{
m_fileExplorer.BeginUpdate();
RadTreeNode l_parent = e.Node.Parent;
int
l_nIx = e.Node.Index;
e.Node.Remove();
RadTreeNode l_new = CreateDirNode(
new
DirectoryInfo(e.Node.Name),
true
);
l_parent.Nodes.Insert(l_nIx, l_new);
l_new.Expand();
m_fileExplorer.EndUpdate();
}
}
}
// OnDirExpandedChanged
private
void
OnCdInsert(
object
sender, EventArrivedEventArgs e)
{
ManagementBaseObject l_wmiDevice = (ManagementBaseObject) e.NewEvent[
"TargetInstance"
];
string
l_sDriveRootDir = l_wmiDevice[
"Name"
].ToString() + Path.DirectorySeparatorChar;
int
l_nIx = m_fileExplorer.Nodes[0].Nodes.IndexOf(l_sDriveRootDir);
m_fileExplorer.Nodes[0].Nodes[l_nIx].Remove();
// (1)
m_fileExplorer.Nodes[0].Nodes.Remove(l_sDriveRootDir);
// (2)
}
// OnCdInsert