RadToolBar provides a flexible client-side API - you can easily interact with the toolbar in the browser using the toolbar client-side object.
var toolBar = $find("<%=RadToolBar1.ClientID%>");
var toolBar = $find("<%= RadToolBar1.ClientID %>"); var text = $get("<%= TextBox1.ClientID %>").value; var item = toolBar.findItemByText(text);
function toggleButton() { var toolBar = $find("<%= RadToolBar1.ClientID %>"); var text = $get("<%= TextBox1.ClientID %>").value; var item = toolBar.findItemByText(text); if (!item) { alert("There is no item with text \"" + text + "\""); return false; } if (!Telerik.Web.UI.RadToolBarButton.isInstanceOfType(item)) { alert("The item with the specified text is not a button.\nOnly buttons can be checked/unchecked"); return false; } if (Telerik.Web.UI.IRadToolBarDropDownItem.isInstanceOfType(item.get_parent())) { item.get_parent().showDropDown(); item.toggle(); } return false; }
www.telerik.com | Terms of Use | Contact Us