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

Treeview in Rad Combobox

4 Answers 81 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
VIvek
Top achievements
Rank 1
VIvek asked on 13 Oct 2008, 08:59 PM
Hello,
Here is my scenario.
1. I am using this control as part of webpart (for MOSS integration). I've autopostbacks disabled on this control. I am trying to spit some javascript to be used at runtime on the blur event of the combobox. This is throwing error saying this script is not found even though i've added that script to the page. I can see this script on the page (View source). I'm using this snippet for that.Pleaselet me know how can i resolve this.

 private void SpitWrapperJavascriptToPage()
        {
            string strGetSelectedNodes = "function companyblur(sender, eventArgs)";
            strGetSelectedNodes += " {ctlCompany_onBlur();}";
            Page.ClientScript.RegisterStartupScript(typeof(RadTreeView), "wrapperCompany", strGetSelectedNodes, true);

        }
protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
SpitWrapperJavascriptToPage();
            cmbCompany.OnClientBlur = "companyblur";
}

4 Answers, 1 is accepted

Sort by
0
VIvek
Top achievements
Rank 1
answered on 13 Oct 2008, 11:22 PM
Ok. I figured the one below. There was a javascript error in my function. Now that it is done, i am not able to get list of selected nodes on the client side. I, however, can get to correct no. of nodes in tree i.e. get_nodes().get_count() works fine, but get_selectedNodes.length returns 0. here is the code that i inject into page for the same.

   public void SpitCommonJavascript()
        {
            string strSelectedNodes = "function GetNodes(tree){var rtrnStr ; rtrnStr='';";
            strSelectedNodes += "var nodes = tree.get_selectedNodes();  if(nodes == null) {alert('Null')};";
            strSelectedNodes +=  " for (var i = 0; i < nodes.length; i++) {";
            strSelectedNodes += " rtrnStr += nodes[i].get_text();}";
            strSelectedNodes += " return rtrnStr ;}";

                      
            Page.ClientScript.RegisterClientScriptBlock(typeof(RadTreeView), "common1", strSelectedNodes, true);
        }

0
Veselin Vasilev
Telerik team
answered on 14 Oct 2008, 08:05 AM
Hi VIvek,

The reason for that would be that the treeview does not have a selected node/nodes.

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
VIvek
Top achievements
Rank 1
answered on 15 Oct 2008, 10:04 PM
Hello,
I am using Evaluation version of controls fpr a POC. I am using these with MOSS.
My control has suddenly stopped loading with following error.
A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.

This control is added to safecontrols section of my web.config. Please help. I've a demo in 1 hour.

Thanks
Vivek
0
Atanas Korchev
Telerik team
answered on 16 Oct 2008, 02:42 PM
Hello VIvek,

Most probably the Telerik.Web.UI.dll assembly is not installed on your server. You can check the event log for the exact error message.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
VIvek
Top achievements
Rank 1
Answers by
VIvek
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Atanas Korchev
Telerik team
Share this question
or