hi,
when setting tree to self reference table like so:
treeView.InitializeDataNode += new InitializeDataNodeEventHandler(treeView_InitializeDataNode);DataRelation r = new DataRelation("name" + group.Key, myData.Tables["Hierarchy" + group.Key].Columns[0], myData.Tables["Hierarchy" + group.Key].Columns[1]); myData.Relations.Add(r); treeView.SetDataBinding(myData, "Hierarchy" + group.Key);
myData.Relations.Add(r);
treeView.SetDataBinding(myData, "Hierarchy" + group.Key);
and running a small sub to determine which nodes are to be displayed like so:
private void treeView_InitializeDataNode( object sender, Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs e) { if ((e.Node.Level == 0) && (e.Node.Cells["parentkey"].Value.ToString() != string.Empty)) e.Node.Visible = false; else { e.Node.Text = e.Node.Cells["childCat"].Value.ToString(); } }
{
if ((e.Node.Level == 0) && (e.Node.Cells["parentkey"].Value.ToString() != string.Empty)) e.Node.Visible = false;
e.Node.Visible = false;
else
e.Node.Text = e.Node.Cells["childCat"].Value.ToString();
}
the statement "e.Node.Text = e.Node.Cells["childCat"].Value.ToString();" is executed, but the text attribute of node stays.
any ideas? suggestions? on how to control the Node.Text??
tnx in advance for help.
J.
Sorted!!!
Thanks nevertheless.