Combobox scroll not Properly

5 posts, 1 answers
  1. Hamid
    Hamid avatar
    3 posts
    Member since:
    Apr 2011

    Posted 25 Apr 2011 Link to this post

    Hi,
    I'm using RadCombobox Ajax control ,I have 2 combo box the second one fills programmatically on OnClientDropDownOpening event according to the first combo's selected item ,
    It works properly but sometimes The  2nd combo dropdownlist become very small and scroll ,Here is my code :
    Markup:
    <telerik:RadComboBox ID="cmbDescription"  Filter="StartsWith" AllowCustomText="true" 
    
                                                 MaxLength="256" Style="margin-right: 1px"
                                                runat="server" OnClientSelectedIndexChanged="cmbDescription_onClinetSelectedIndexChanged" OnClientDropDownOpening="cmbDescription_OnClientDropDownOpening"  >
                                           
    javascript:
    function cmbDescription_OnClientDropDownOpening(sender, args) {
        var tempSLRef = grdVoucherItems.get_tempEntity().SLRef;
        if (currentSLRef !== tempSLRef) {
          
                currentSLRef = tempSLRef;
                PageMethods.FetchAllSLStandardDescBySLID(currentSLRef, AjaxFetchAllSLStandardDescSucceeded, OnPageMethodFailed, null);
          
        }
    }
    function AjaxFetchAllSLStandardDescSucceeded(result, context) {
        lstSlStandardDescs = result;
        cmbDescription.get_items().clear();
        for (var i = 0; i < lstSlStandardDescs.length; i++) {
            var comboItem = new Telerik.Web.UI.RadComboBoxItem();
            comboItem.set_text(lstSlStandardDescs[i].Item1);
            comboItem.set_value(lstSlStandardDescs[i].Item3);
            cmbDescription.trackChanges();
            cmbDescription.get_items().add(comboItem);
            cmbDescription.commitChanges();
            
        }



  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 26 Apr 2011 Link to this post

    Hello Hamid,

    I would suggest that you use the approach described in the following demo of the RadComboBox.

    Best wishes,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Hamid
    Hamid avatar
    3 posts
    Member since:
    Apr 2011

    Posted 27 Apr 2011 Link to this post

    Hello Kate,
    thanks for your recommendation,
    But  there are still a problem:
    I should describe my problem deeper i think.
    Actually I have a grid view which has 3 column like this "combobox","combobox","textbox"
    the first combobox is attached to a webservice method so It fills when itemrequested event fire
    Then I want to fill second combo according to the first combo selected item when the OnClientDropDownOpening event fire
    (by calling webmethod programtically form js code)
    and also I want to set the textbox text property when second comboSelectedIndex change event fire
    So its better to trensfer all the data to client to set the textbox.text without callback again
    (I can fetch all data by calling the webmethod  which calls by OnClientDropDownOpening event of second combo )
    There is any solution ?!?
    thank you any way.
  4. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 02 May 2011 Link to this post

    Hi Hamid,

    Thanks for the details on your scenario. I believe that this demo (it includes grid and related combos) is very close to your scenario and it will help you resolve the issue that you encounter. Please take a look at its implementation and let me know if it helps.  

    Kind regards,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Hamid
    Hamid avatar
    3 posts
    Member since:
    Apr 2011

    Posted 03 May 2011 Link to this post

    Thanks a lot Katy,
    I solved my problem finally ,
    But there is a trick here , actually I solved it by write some code after adding items to combo :
    cmb.hideDropDown();
    cmb.showDropDown();
    I found them in the demo you've sent.
    Now the dropdown doesn't scroll any more. " You think there is any bug in radcombobox or the way I use it is wrong?!?"
     any way ,Thank you again ,It was going to become a nightmare for me.
Back to Top