This is a migrated thread and some comments may be shown as answers.

AutoPostBack Property Not Available

3 Answers 273 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 24 Apr 2008, 01:57 PM
I am programatically creating a RadTreeView control and trying to set the AutoPostBack property to true so I can use an event handler for the NodeClick event.

For some reason AutoPostBack is not showing up in intellisense in my visual studio window, and even if i type it out and try to compile my code it gives me an error that 'AutoPostBack' is not a member of 'Telerik.Web.UI.RadTreeView'

I have looked over the examples on this website using RadTreeView and they are setting the AutoPostBack property to "True", which leads me to believe the property does exist (which is why I tried it in the first place). Or am I using the wrong tree view control in the first place?

What I am really trying to accomplish is to handle an event when one of the child nodes are clicked, so I can get the value and populate a textbox with it.

Any help or clarification on how the postback is supposed to work with the RadTreeView control would be greatly appreciated.

- John

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Apr 2008, 02:16 PM
Hi John,

Indeed the AutoPostBack property has been removed. Now it is no longer required. Simply subscribing to a postback event would enable postbacks. In your case you just need to subscribe to NodeClick.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
terrysmith
Top achievements
Rank 1
answered on 30 Apr 2008, 09:52 PM
When I use AddHandler in VB.NET to add a NodeCheck event handler, autopostback is not enabled. The server event is never hit on a click.

Here is why I'm trying to use AddHandler. The tree is in a UserControl which is used in a couple of different situations. In one case the tree doesn't have checkboxes, and I don't want it to do an autopostback. However, I have the NodeCheck event defined it does an autopostback even on a drag-and-drop which causes me a lot of problems. (It just won't work in this situation.)

In the other case the tree has checkboxes and I want to catch the NodeCheck event. I removed the "wired at design time" handler and was trying to use AddHandler to wire it at runtime for this scenerio, but the event handler is never fired.

Any suggestions?

Thanks,
Terry

0
Atanas Korchev
Telerik team
answered on 01 May 2008, 08:40 AM
Hello terrysmith,

Please find attached example how to use AddHandler with RadTreeView. I suspect in your case you are not calling the AddHandler function after postback so the event is not wired after postback. Hence your event handler is not executed.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
John
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
terrysmith
Top achievements
Rank 1
Share this question
or