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

[Solved] RadComboBox in RadGrid

1 Answer 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 14 Feb 2008, 10:20 PM
I have a GridTemplateColumn in a RadGrid (inplace editing) where the EditItemTemplate contains a user control.  The user control is a RadComboBox with an ItemTemplate of a RadTreeview.  The user control has a small amount of javascript that gets written out to a RadScriptBlock, the script containing a function to handle the OnClientNodeClicked event of the treeview.  Below is that javascript:

function OnTreeviewSelect(sender, args) {
    if (args.get_node().get_nodes().get_count() == 0) {
        var value = args.get_node().get_value();
        var text = args.get_node().get_text();
        $find("<%= RadComboBox1.ClientID %>").set_text(text);
    }
}

If I do an insert, the control works fine.  If I load up the page and try to do an edit first (without attempting an insert), I get a javascript error saying "OnTreeviewSelect" is not a function on the page.  If I do an insert, then try to do an edit, I get passed the error about the function not existing, but I get a javscript error saying that the RadComboBox is null.  What is the difference between inplace inserting and inplace editing?  Why would it always work for inserting and throw various javascript errors when editing?

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 18 Feb 2008, 04:01 PM
Hi Steve,

Thank you for the explanation.

There should be no difference for the javascript code evaluation whether you insert or edit grid item using inplace editing.

Can you please check whether the entire grid is refreshed on ajax request (using RadAjaxManager of RadAjaxPanel Prometheus) and test whether replacing the RadCodeBlock control with RadScriptBlock alleviates the abnormality? Note that the RadScriptBlock control supports server code blocks in javascript in the same way as RadCodeBlock with the addition that the javascript will be evaluated on each ajax refresh:

http://www.telerik.com/help/radcontrols/prometheus/?ajxRadScriptBlockRadCodeBlock.html

If the issue persists, the best means to progress in our investigation is to assemble a stripped working version of your project and send it attached to a formal support ticket. We will examine it locally and will get back to you with more info on the matter.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Steve
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Share this question
or