help me on tree view
hi everybody.
I'm really need your help.
I'm recently work with treeview(system.windows.forms.treeview).And i found something that really strange.
i have a class with some event.
i'm also create a form class with a treeview on it.This form class have method that handle the event that raised by my class.this method will add some node on the tree view .it was succesfully triggered and the method that add the node executed.But strange the node doesn't appear on the tree view.Here is my code :
class :
public delegate void FillIt(string nodeText);
public class DelegatedClass
{
public event FillIt GoFilling;
public DelegatedClass()
{
}
public void Notifikasi(string tes)
{
foreach (FillIt usil in GoFilling.GetInvocationList())
{
usil.BeginInvoke(tes ,null,null);
}
}
}
in the form class i have this
member variable :
protected DelegatedClass _delegasi;
on konstructor :
_delegasi = new DelegatedClass();
_delegasi.GoFilling+=new FillIt(Tes );
on
some button i have :
_delegasi.Notifikasi(uiNodetextBox.Text);
method that handle delegate :
private void Tes(string pesan)
{
controlledtreeView.Nodes.Add(pesan);
controlledtreeView.Update();
}
When i run it and press the button it enter the tes method , but the node did't appear.
please help me
:(
|