Enabling RadComboBox using Javascript

4 posts, 0 answers
  1. Monik
    Monik avatar
    7 posts
    Member since:
    Apr 2015

    Posted 20 Jul 2015 Link to this post

    I have following RadComboBox that triggers a javascript function which in turn enables a different RadComboBox

    <telerik:RadComboBox ID="ddlMode"  runat="Server"  CssClass="selectBox"  AutoPostBack="false"  Width="90"  Font-Size="Small" OnClientSelectedIndexChanged="ddlMode_OnClientSelectedIndexChanged"><Items><telerik:RadComboBoxItem Text="New" Value="0" Selected="true"/><telerik:RadComboBoxItem Text="Edit" Value="1"  />
    </Items>
    </telerik:RadComboBox>

     

    Following is the Javascript called:

    function ddlMode_OnClientSelectedIndexChanged(sender, args) {
              debugger;
              var category = $find("<%= ddlPRInfo_ItemCategory.ClientID %>");
              category.enabled = true;
    }

    But it doesn't work.

    Please guide on same..

  2. Aneliya Petkova
    Admin
    Aneliya Petkova avatar
    207 posts

    Posted 20 Jul 2015 Link to this post

    Hi Monik,

    The .enabled client-side property of RadComboBox returns a bool value - true or false, showing if the control is enabled or it is disabled.

    To enable the control, you must use enable() method:
    function ddlMode_OnClientSelectedIndexChanged(sender, args) {
        var category = $find("<%= ddlPRInfo_ItemCategory.ClientID %>");
        category.enable();
    }

    Regards,
    Aneliya Petkova
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Monik
    Monik avatar
    7 posts
    Member since:
    Apr 2015

    Posted 20 Jul 2015 Link to this post

    Hi Aneliya,

    Thanks for the reply, I tried with your suggestion and it still doesnt work.

  5. Aneliya Petkova
    Admin
    Aneliya Petkova avatar
    207 posts

    Posted 20 Jul 2015 Link to this post

    Hi Monik,

    I made for you a sample project using the code you provided, where on selection of item from the first RadComboBox, the second one gets enabled. Here you may find a video, showing the result of my test.

    You may find more information on client-side API in our documentation:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/client-side-programming/overview

    Hope this will be helpful.

    Regards,
    Aneliya Petkova
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top