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

Getting a RadTreeView added Dynamically on a ComboBox Client-Side

0 Answers 57 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Denis asked on 09 Dec 2012, 01:06 AM
Hi Team,

I have very peculiar process.

I am adding in my page on code-behind in the Init of the page a Radcombobox with a dynamic ID. Furthermore I am adding a RadtreeView to it on codebehind with a fix id and with only one node

using this idea:
 public void InstantiateIn(Control container)
            RadTreeView tree = new RadTreeView();
            tree.ID = "tv";
            tree.CheckBoxes = true;


Now my big deal is I want to load that RadTreeView on demand and client-side . My problem came with the JavaScript that is not fiding the controls that have been added on the code behind

I try to add on the load page using a RadCodeBlock the script to find the control but it is not working. Also I tried Sys.Application.add_load(ale)

something like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();     
            sb.Append(@"<script language='javascript'>");
            sb.Append(@"alert('Hello World');");
            sb.Append(@"var comboBOX = document.getElementById('<%= 2.ClientID %>'); ");
            sb.Append(@"function ale(){alert(comboBOX);}");

Could you help me with an example or some guidance to get the ComboBox that I loaded dynamically with a dynamic ID on Java Script or JQuery. When I get the comobo box how the treeview has a predefined ID I will be able to get it on client-side.

Thank you
            LiteralControl literaJS = new LiteralControl(sb.ToString());

No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 2
Share this question