I recently posted a problem about disabling controls client-side within a RadGrid FormTemplate: http://www.telerik.com/community/forums/aspnet-ajax/input/unable-to-find-a-usable-method-for-enabling-disabling-a-textbox-in-a-formtemplate.aspx
That screen works. I can now control the enabling/disabling of RadTextBoxes using a function call from a checkbox.
Now I have a similar problem. I have a similar screen in which the FormTemplate has several RadComboBoxes and RadButtons.
What I want to do is enable/disable a RadComboBox and a RadButton depending on the value of another RadComboBox.
I've attached a function to a RadComboBox's OnClientSelectedIndexChanged event. I know the function is being called. I know I'm getting the correct value of the dropdown. I know I'm getting back handles from the $telerik.findElement calls. As far as I can tell from your documentation I'm using the correct enable/disable calls for a RadButton and RadComboBox.
But this time nothing works. The status of the controls is not changing. Here's the code.
That screen works. I can now control the enabling/disabling of RadTextBoxes using a function call from a checkbox.
Now I have a similar problem. I have a similar screen in which the FormTemplate has several RadComboBoxes and RadButtons.
What I want to do is enable/disable a RadComboBox and a RadButton depending on the value of another RadComboBox.
I've attached a function to a RadComboBox's OnClientSelectedIndexChanged event. I know the function is being called. I know I'm getting the correct value of the dropdown. I know I'm getting back handles from the $telerik.findElement calls. As far as I can tell from your documentation I'm using the correct enable/disable calls for a RadButton and RadComboBox.
But this time nothing works. The status of the controls is not changing. Here's the code.
function test(sender, args) {
var editForm = $find("<%=RadGrid1.ClientID%>").get_masterTableView().get_editItems()[0].get_editFormItem();
var btn = $telerik.findElement(editForm, "btnSave");
var combo = $telerik.findElement(editForm, "ComboBox1");
var curVal = sender.get_value();
// if the calling combo box has this value,
// disable the other controls.
if (curVal == 3) {
btn.set_enabled(false);
combo.disable();
}
// Otherwise, enable
else {
btn.set_enabled(true);
combo.enable();
}
}