<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript">
function OnClientLoad(combobox, args)
{
    makeUnselectable(combobox.get_element());
}

function OnClientItemsRequested(combobox, args)
{
    $telerik.$("*", combobox.get_dropDownElement()).attr("unselectable", "on");
}
    
//Make all combobox items unselectable to prevent selection in editor being lost
function makeUnselectable(element)
{
    $telerik.$("*", element).attr("unselectable", "on");
}
  
function getSelectedItemValue(combobox, args)
{
  var value = combobox.get_value();
  //alert("The selected combobox value is: " + value);
  //get a reference to RadEditor client object 
  //and paste the selected combobox item content in it
  var editor = $find("<%=RadEditor1.ClientID%>"); 
  editor.pasteHtml(value);
}  
</script>
<telerik:radeditor runat="server" ID="RadEditor1" Content="test mest"></telerik:radeditor>
<div style="padding: 15px 0 0 0;font-family:Arial;font-size:14px;">
    RadComboBox with static items:
    <telerik:RadComboBox OnClientSelectedIndexChanged="getSelectedItemValue" OnClientLoad="OnClientLoad" ID="RadCombobox1" runat="server">
        <Items>
            <telerik:RadComboBoxItem Text="Item1" Value="<strong>Item 1</strong>" />
            <telerik:RadComboBoxItem Text="Item2" Value="<strong>Item 2</strong>" />
            <telerik:RadComboBoxItem Text="Item3" Value="<strong>Item 3</strong>" />
        </Items>
    </telerik:RadComboBox>
</div>
<div style="padding: 15px 0 0 0;font-family:Arial;font-size:14px;">
    RadComboBox with Load-On-Demand:
    <telerik:RadComboBox OnClientSelectedIndexChanged="getSelectedItemValue" OnClientItemsRequested="OnClientItemsRequested" OnClientLoad="OnClientLoad" ID="RadCombobox2" runat="server" 
        OnItemsRequested="RadCombobox2_ItemsRequested" EnableLoadOnDemand="true"></telerik:RadComboBox>
</div>

    </form>
</body>
</html>
