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

[Solved] treeview in user control

4 Answers 25 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bob
Top achievements
Rank 1
Bob asked on 23 Nov 2010, 09:08 AM
Hey fellas, 

My Scenario: 
A simple treeview inside a user control, ascx file.
That user control is added twice in a single View, ASPX file (they have same items)
there is only one script that handles actions and events for the treeview

The Lovely Issue:
The 1st treeview is working 100% fine
(i can see the subitems by clicking on the main items, drag and drop, etc..)
BUT the second treeview is only displayed there, clicks and events do not work :(


I guess the issue is due to the way I use ScriptRegistrar, its in Site.Master
What is the best way to define my scripts assets in such scenarios ?

or Am I looking in wrong direction?

Any help is greatly appreciated..

Thanks,
Bob.

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 09:31 AM
Hi Bob,

 Check the troubleshooting and loading partial views with ajax help topics.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Bob
Top achievements
Rank 1
answered on 23 Nov 2010, 12:23 PM
Thanks Atanas for your quick reply, but It didn't fix my problem..
I found out both TreeViews are having same ID i defiend in the user control. is there anyway to dynamically change that Id?

Regards,
Bob.
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 12:28 PM
Hi Bob,

You need to use some code to generate the TreeView ID dynamically. For example you can use a GUID or some random number. ASP.NET MVC does not provide any mechanism for ID generation.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Bob
Top achievements
Rank 1
answered on 23 Nov 2010, 03:20 PM
Dear Atanas,

You've been very helpful, and I really appreciate that..
When you get a chance, Would you please have a look at the attached project and try to do some of your magic to make it work?!

Simple info regarding project: 
A tabstrip + two render partial of the treeview UC in each tab inside Views\Home\Index.aspx 



p.s This is a simple treeview and project just to point out what my problem is..

Thanks again,
Bob.
Tags
TreeView
Asked by
Bob
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Bob
Top achievements
Rank 1
Share this question
or