This is a migrated thread and some comments may be shown as answers.

Combobox scroll not Properly

4 Answers 103 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Hamid
Top achievements
Rank 1
Hamid asked on 25 Apr 2011, 06:22 AM
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();
        
    }



4 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 26 Apr 2011, 01:26 PM
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.

0
Hamid
Top achievements
Rank 1
answered on 27 Apr 2011, 07:11 AM
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.
0
Accepted
Kate
Telerik team
answered on 02 May 2011, 02:22 PM
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.

0
Hamid
Top achievements
Rank 1
answered on 03 May 2011, 05:21 AM
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.
Tags
ComboBox
Asked by
Hamid
Top achievements
Rank 1
Answers by
Kate
Telerik team
Hamid
Top achievements
Rank 1
Share this question
or