Declined
Last Updated: 28 Oct 2014 14:31 by Steve
Steve
Created on: 17 Nov 2013 18:32
Category: ComboBox
Type: Bug Report
0
radcombo
Using the .get_value() in the OnClientDropDownClosed event of RadComboBox, produces empty value. The OnClientSelectedIndexChanged event works fine, but I need to be able to kick off the javascript even if the selected index doesn't change. 

My RadComboBox element:

<telerik:RadComboBox ID="CustomerSearch" runat="server" Width="180" Height="160"  
        MarkFirstMatch="true"  AllowCustomText="true" CssClass="CustomerSearch" AutoPostBack="false" 
        EnableLoadOnDemand="true" EnableVirtualScrolling="true" OnItemsRequested="CustomerSearch_ItemsRequested" 
        OnClientDropDownClosed="searchnav" EmptyMessage="Select a customer" DataSourceID="dsCustomer" DataTextField="CustomerName" 
        DataValueField="NavPath" BackColor="White" Skin="Forest" />

My SQLDataSource element:
<asp:SqlDataSource ID="dsCustomer" runat="server"
    SelectCommand="CustomerSearchName" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

My Javascript:
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function searchnav(sender, args) {
            var iframe = document.getElementById('ctl00_iMainPages');
            iframe.src = sender.get_value();
        }
    </script>
</telerik:RadScriptBlock>
2 comments
Steve
Posted on: 18 Nov 2013 13:30
The alert is empty. sender.get_value() is not returning anything. I have version 2013.3.1114.40 of Telerik.Web.UI.dll loaded in the project.
Elena
Posted on: 18 Nov 2013 10:24
The following code works without problem at our side with the latest version:

 <telerik:RadComboBox ID="CustomerSearch" runat="server" Width="180px" Height="160px"  
        MarkFirstMatch="True"  AllowCustomText="True" CssClass="CustomerSearch" 
        EnableLoadOnDemand="True" EnableVirtualScrolling="True" 
        OnItemsRequested="CustomerSearch_ItemsRequested" 
        OnClientDropDownClosed="searchnav" EmptyMessage="Select a customer" 
        DataSourceID="SqlDataSource1" DataTextField="ProductName" 
        DataValueField="ProductId" BackColor="White" Skin="Forest" />

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
            SelectCommand="SELECT * FROM [Products]">
        </asp:SqlDataSource>

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function searchnav(sender, args) {
         alert(sender.get_value());
        }
    </script>
</telerik:RadScriptBlock>

Could you please try it at your side?