Hi all,
this topic is driving me nuts. ;)
With this article: http://aspalliance.com/732 I was able to get my treeview built on demand. If I expand a node, the server retrieves the necessary data froman SQL database (in my case) and then populates the treeview without the need of a postback. Client Callback makes this possible. ;)
Every new node gets a checkbox. Since ASP.NET 2.0 does not add an autopostback to the treeview, the state of the checkboxes can only be seen by the server after a postback triggered somehow else. This does not matter, since I have a Button on my page that finally triggers a postback.
With this article: http://www.webswapp.com/codesamples/viewsource.aspx?file=~/codesamples/aspnet20/treeview/treenodecheckchanged.aspx I would expect, that when this postback is triggered, all checkbox events get noticed by the server and I can gather them.
The Problem now is, that the TreeNodeCheckChanged event seems to be only triggered by the client, when the checkbox was already there when the treeview has been initially rendered. This means that if I populate a node on demand and programmatically add a checkbox, this checkbox doesn't fire a TreeNodeCheckChanged event...
Is there any way to get this properly working?
Of course I can call a serverside ExpandAll and CollapseAll. This would populate the whole treeview at once and then it would work. But this does not make sense, since I would loose all advantages of using the OnDemand feature... :-(
I hope anyone has an answer to this.
Best regards and thanks
for reading this,
Christian.