RadComboBox SelectedIndexchange event in jquery

6 posts, 0 answers
  1. vijayashankar palanichamy
    vijayashankar palanichamy avatar
    3 posts
    Member since:
    Dec 2009

    Posted 07 Dec 2009 Link to this post

    <radCB:RadComboBox ID="ddlDecimals" runat="server" Skin="HSTM" Width="35px"
      <Items> 
     <radCB:RadComboBoxItem runat="server" Text="0" Value="0" /> 
     <radCB:RadComboBoxItem runat="server" Text="1" Value="1" /> 
    <radCB:RadComboBoxItem runat="server" Text="2" Value="2" Selected="True" /> 
      </Items> 
    </radCB:RadComboBox> 

    $(document).ready(function() {    
     
        var checkddl = $("[id$=ddlDecimals]"); 
        $("[id$=ddlDecimals]").change(function() { 
            alert(this.value); 
        }); 
    }); 

    The change event is not firing for the radcombo  please help me regarding this.
  2. Majid Darab
    Majid Darab avatar
    112 posts
    Member since:
    Dec 2009

    Posted 09 Feb 2010 Link to this post

    i exactly have the same problem
    my pages base on master and content pages and in content pages i have multiviews and inside them i have RadComboboxes...
    so i want to know how can i access those comboboxes with jquery ?
    and
    how can i get selectedindexchange event with jquery?
    i test meny ways but they did not work...
    i google it but all the ways are about default dropdown of vs 2008 not radcombobox...such as selected indexchange
    i would be really really appreciate for helping me
  3. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 09 Feb 2010 Link to this post

    Hello Majid Darab,

    To subscribe to the OnClientSelectedIndexChanged event you need to set that property either inline (in the aspx file) or in the code behind.
    Alternatively you can use the add_selectedIndexChanged(handlername) client method to subscribe to that event as shown here: client-side events.

    Also, do not use $(document).ready because the RadComboBox client object may not be initialized yet. Use pageLoad() or Sys.Application.add_load methods instead.

    Greetings,
    Veskoni
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  4. Majid Darab
    Majid Darab avatar
    112 posts
    Member since:
    Dec 2009

    Posted 09 Feb 2010 Link to this post

    really appreciate it...
  5. Sunil
    Sunil avatar
    7 posts
    Member since:
    Sep 2012

    Posted 28 Feb 2013 Link to this post

    Hi,

    I am using client side event for radcombobox as below
     function OnClientSelectedIndexChanged(sender, eventArgs) {
            var item = eventArgs.get_item();
    
        }

    This event is firing but the value of item coming always same that is the first value.

    So if i select any other item then also i am getting same value that is the first value.

    Thanks,
    Sunil
  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Mar 2013 Link to this post

    Hello Sunil,

    I tried your code but I am not able to replicate the issue and OnClientSelectedIndexChanged is working fine for me and new item is also retrieved in the JS code. Please have a look at the code I tried.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox" runat="server" AllowCustomText="true" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"
        Skin="Vista" EmptyMessage="Please select">
        <Items>
            <telerik:RadComboBoxItem Text="Audi" />
            <telerik:RadComboBoxItem Text="Bugatti" />
            <telerik:RadComboBoxItem Text="Jaguar" />
            <telerik:RadComboBoxItem Text="Lexus" />
        </Items>
    </telerik:RadComboBox>

    JavaScript:
    <script type="text/javascript">
        function OnClientSelectedIndexChanged(sender, args) {
            // To get the item
            var item = args.get_item();
            //To get the item text
            var itemText = args.get_item()._text;
        }
    </script>

    If you have further issues, please provide your full code.

    Thanks,
    Princy.
Back to Top