This is a migrated thread and some comments may be shown as answers.
tree view as navigation and UI for making server changes
9 Answers 62 Views
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 04 Jan 2009, 01:32 AM
I've spent days trying to solve what shoud be a very simple thing - getting a bit frustrated now as could acheive this with "regualr" ajax and asp.net, but totally lost with Telerik! Hopefully just ignorance on my part...

I have  tree view control which will be the navigation. It sits in a rad splitter on the left side. On the right side is the area that will be affected by clicks on my tree view. For example, a tree view click will load one of various screens in the right side pane depending upon which node is clicked - be that a form for entering a survey question or a form for reordering survey sections....

It all works well - a tree view node click leaves the tree view on screen, while the form in the right side pane loads, a cool little loading panel displaying as I wait. But here's the problem...

One operation I want to perform is drag and drop reordering of nodes on the client side - this requires a post back  / server event  so I can refesh the tree view. In this case the tree view will need to do a full post back and completely refresh itself. The problem is that I cannot filter events and therefore when I attempt this my node clicks also beging to do full post backs causing y tree view to dissapear!

The event filter on radajaxmanager does not work, despite (seemingly) conflicting posts I've seen in this forum. And using ajaxManager.ajaxRequestWithTarget and/or ajaxManager.ajaxRequest seems to provide no resolution (mostly errors, limitations and frustration at how little documentation there is on this)

Any help at all would be appreciated ...





9 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 04 Jan 2009, 06:47 AM
I'm not at all sure what I shoud be expecting from ajaxRequest function...

What I have now is ajaxrequest working on the server (as in, I can see it is being called via javascript and firing on the sever) but not doing anything on my page. The label control I update in ajaxrequest handler on server does not update on my page as expected - I can't even tell from docs if it shoud be doing so or not? Its an async call, I update a label control which is configured in ajaxmanger, it shoud be update - that my assumption anyway.

It's configred correctly as initator, target etc in ajaxmamanger - so shoud teh ajaxrequest call  do teh parti
al update as expected?
0
Accepted
Iana Tsolova
Telerik team
answered on 06 Jan 2009, 01:30 PM
Hello Andy,

You can use the ajaxRequest client-side method of RadAjaxManager to invoke an ajax request explicitly. Then you can you can handle this request in the server AjaxRequest event in order to update the TreeView. Note that you need to set the RadAjaxManager as ajax initiator updating the TreeView so the made changes take effect.

Check it out and let me know how it goes.

Best wishes,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andy
Top achievements
Rank 1
answered on 06 Jan 2009, 11:29 PM
re: Note that you need to set the RadAjaxManager as ajax initiator

This was  indeed the problem - I still had tree as initiator as I though this was correct -  I spotted this in the docs when reading through more thoroughly.

Though still not entirely sure of situations in which ajaxRequest and ajaxRequestWithEventTarget shoud be used (whcih was also part of the problem I had). I'd appreciate if you could explain when a good time to use one vs the other is?

Thanks
0
Iana Tsolova
Telerik team
answered on 08 Jan 2009, 03:05 PM
Hello Andy,

Straight to your questions:

  • using the ajaxRequest() method - in this case you need to add ajax setting where the manager updates the TreeView and you can handle the request in the RaisePostBackEvent
  • using the ajaxRequestWithTarget() method - here you need to pass as first parameter of the method the UniqueID of the TreeView and second empty string parameter. And you need an ajax setting where the TreeView updates itself. You can handle the request in the appropriate TreeVeiw event, e.g NodeClick, NodeExpanded, etc.

Further information is available in the below resources:
http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html
http://www.telerik.com/help/aspnet-ajax/ajxaddajaxrequesttoclientevent.html

Regards,

Iana
the Telerik team

 


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andy
Top achievements
Rank 1
answered on 09 Jan 2009, 04:25 AM
The main part of my question was "I'd appreciate if you could explain when a good time to use one vs the other is?"

I'm using ajaxRequest at the moment, no problems. But I haven't a clue if this is the right approach and I haven't a clue why I'd ever use AjaxRequestWithTarget. What is the point of one versus the other? Can you tell em when one is of no use an dthe other must therefore be used??

The docs don't really talk in such terms...

Thanks for assistance with this...

0
Iana Tsolova
Telerik team
answered on 09 Jan 2009, 03:14 PM
Hello Andy,

Both approaches are rather equal, there is no less ot more right one. It depends on your personal preferances if you would like to handle the ajax request in the RadAjaxManager AjaxRequest event (when calling the ajaxRequest() method), or in the particular control event.

I hope this helps.

Greetings,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andy
Top achievements
Rank 1
answered on 10 Jan 2009, 12:43 PM
re: I hope this helps.

Sure does - I thought I was missing some key concept here! As you say, just a preference...

Thanks for all the assistance provided.
0
Mohan
Top achievements
Rank 1
answered on 01 Dec 2011, 10:17 PM
Hey Andy,

I have  tree view control which will be the navigation. It sits in a rad splitter on the left side. On the right side is the area that will be affected by clicks on my tree view. For example, a tree view click will load one of various screens in the right side pane depending upon which node is clicked - be that a form for entering a survey question or a form for reordering survey sections....


I am struggling with this one.., pls. point me to right direction to follow  with a snippet if possible..
Thanx,
~Mohan

0
Iana Tsolova
Telerik team
answered on 02 Dec 2011, 02:40 PM
Hello Mohan,

Can you elaborate on the specific issues you faced while implementing the desired functionality?
You do not know how to handle the TreeView node click and then load proper control in the right pane? Or it is something else you find hard to implement?

For more information on the TreeView, I suggest that you refer to the below articles and samples:
http://www.telerik.com/help/aspnet-ajax/treeview-server-side-programming-basics.html
http://www.telerik.com/help/aspnet-ajax/treeview-server-events.html
http://www.telerik.com/help/aspnet-ajax/treeview-server-node-click.html
http://demos.telerik.com/aspnet-ajax/treeview/examples/applicationscenarios/customattributes/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/treeview/examples/programming/serversideapi/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/webmail/

Kind regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Iana Tsolova
Telerik team
Mohan
Top achievements
Rank 1
Share this question
or