Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
TreeView.SetDataBinding(object dataSource,string dataMember) and DispalyText
posted

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);

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();

}

}

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.