Client Side API Not working..

6 posts, 0 answers
  1. Matthew
    Matthew avatar
    13 posts
    Member since:
    Apr 2008

    Posted 05 Feb 2009 Link to this post

    Hello...

    No matter what I do, I cannot get the ClearSelection client side method to work.

    I keep getting a JScript error.

    I have tried every way possible to get this to work including hard coding the full ID.

    To make things worse, the combo box is inside of a Radgrid.

    Can somebody please give a suggestion..

    Matthew..
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 06 Feb 2009 Link to this post

    Hi Matthew,

    Which version of RadComboBox are you using? You have posted in the forum of RadComboBox for ASP.NET Ajax however you are using the ClearSelection method which is from RadComboBox classic.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matthew
    Matthew avatar
    13 posts
    Member since:
    Apr 2008

    Posted 06 Feb 2009 Link to this post

    I am using Radcontrols for ASP.NET AJAX... Version Q3.2008 SP1.
    if this is a classic method, what method do I use.

    Please do not tell me to use AJAX.  I need to have this completely client side because the grid is HUGE, and I am very fluent with javascript.  I did get the box to clear, but I had to get the _input wrapper and clear it there.  I would rather use a method if one exists.

    Matthew.
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 06 Feb 2009 Link to this post

    Hello Matthew,

    You need to use clearItems() method (note the first letter is lower case).

    You can find all public methods of the RadComboBox client object here:
    Client-Side Programming > RadComboBox object

    Sincerely yours,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Matthew
    Matthew avatar
    13 posts
    Member since:
    Apr 2008

    Posted 06 Feb 2009 Link to this post

    That did not work... I am sending the code... 

    I use the API for other controls in other places, with no problems....

    function

    setCrewDropDown(checkbox)

    {

    var controlNumber = checkbox.name.split('$')[4];

     

    // get control

     

     

    var stringPartner = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_DropDownPartner";

    var stringSplit = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_divCbSplit";

    var stringStatus = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_RadioButtonListStatus";

    var stringButtonReset = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_ButtonReset";

     

     

    var ctlPartner = document.getElementById(stringPartner);

    var ctlSplit = document.getElementById(stringSplit);

    var ctlStatus = document.getElementById(stringStatus);

    var ctlButtonReset = document.getElementById(stringButtonReset);

     

     

    if(checkbox.checked)

    {

    ctlSplit.style.display = "";

    ctlPartner.style.display="";

     

    ctlStatus.style.display = "none";

    ctlButtonReset.style.display = "none";

     

    }

     

    else

     

    {

     

     

    resetOldPartnerByName(ctlPartner.value);

    ctlPartner.style.display = "none";

    ctlSplit.style.display = "none";

    ctlStatus.style.display = "";

    ctlButtonReset.style.display = "";

    ctlPartner.clearItems();

     

     

    // // Clear combo box selection .. for some reason the Telerik Clientside API does not work!!!!

    //

    // var stringPartner1 = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_DropDownPartner_Input";

    // var ctlPartner1 = document.getElementById(stringPartner1);

    // ctlPartner1.value = " "

     

    }

     

    }

  7. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 09 Feb 2009 Link to this post

    Hello Matthew,

    You need to get a reference to the combobox client object by using:

    //make sure that stringPartner1 is the correct ID of the combobox !! 
    var stringPartner1 = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_DropDownPartner"
     
    var combo = $find(stringPartner1); 
    combo.clearItems(); 

    I hope this helps.

    Sincerely yours,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017