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

Can OnClientDropDownOpening Callback to the Server

7 Answers 165 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 22 Oct 2008, 01:26 PM
Hi, I'm currently in the process of evaluating the RadControls to see if it meets our needs for a project we're working on.

I have a RadComboBox that is created at runtime and added (via a Template) to a cell in the RadGrid.

Currently, at runtime I set:

combo.OnClientDropDownOpening = "OnClientDropDownOpening"

which fires the:

    function OnClientDropDownOpening(sender, args)  
    { 
    }    

javascript function.

How do I go about initiating a server callback that passes back the current control and its value, performs a custom query based on that value, and populates the Item collection of the RadComboBox without posting back the entire page?

I've explored the RadComboBox.EnableLoadOnDemand property, but it appears that it makes callbacks when the text is changed, which is not what we want.

If there are alternative methods to handling the event client-side, I'm open to them.

Thank you.

7 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 22 Oct 2008, 01:45 PM
Hi Andrew,

If you use the load-on-demand - it fires the ItemsRequested server-side event when you change the text in the combobox or when you open the dropdown. I think this will help you achieve your goal.

All the best,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andrew
Top achievements
Rank 1
answered on 22 Oct 2008, 02:02 PM
When I click the dropdown button on the RadComboBox I get an error that pops up and reads: "'HeaderGird$radGrid$ctl00$ctl04$ctl102' for the callback could not be found or did not implement ICallbackEventHandler."

Once I click OK on that error dialog, the RadComboBox drops down and says "Loading..." Nothing happens after that. Any idea what this error means?
0
Veselin Vasilev
Telerik team
answered on 24 Oct 2008, 11:37 AM
Hello Andrew,

I suggest that you send us a sample project demonstrating the problem. We will test it locally and find a solution.
In addition, you can check these links:

Best wishes,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Andrew
Top achievements
Rank 1
answered on 06 Jan 2009, 05:53 PM
Alright, I've created a sample project that can be downloaded here:

http://dl.getdropbox.com/u/109257/RadGridComboSample.zip

In the source folder you will see a file entitled "TestScenario.txt." It contains information necessary as to what is being done in the sample and what we need it to do. If you have any questions at all please feel free to ask.

Thank you,
Andrew
0
Veselin Vasilev
Telerik team
answered on 09 Jan 2009, 05:14 PM
Hi Andrew,

I have changed the Default.aspx.cs file and attached the modified version here.
Please download it and give it a try.

I hope this helps.

All the best,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shahzada
Top achievements
Rank 1
answered on 27 Apr 2012, 08:06 AM
I have placed Radcombobox inside radGrid.
Now try to remains opened radcombobox by calling OnClientDropDownOpening="OnClientDropDownOpening" using ajax request.
But it gets closed automatically.
I want it to remains opene after rebind radcombobox.




                                <telerik:RadComboBox ID="ddlAssignedTo" runat="server" AutoPostBack="true" CssClass="assigned_to_combo"
                                    OnClientDropDownOpening="LoadEmployees" OnSelectedIndexChanged="ddlAssignedTo_OnSelectedIndexChanged">
                                </telerik:RadComboBox>
                            




function LoadEmployees(combo, eventarqs) {


                var flag = "";
                var grid = $find("<%=dtgProspect.ClientID %>");
                var masterTableView = grid.get_masterTableView();
                if (masterTableView != null) {
                    var gridItems = masterTableView.get_dataItems();
                    var i;
                    for (i = 0; i < gridItems.length; ++i) {
                        var gridItem = gridItems[i];
                        var ddl = gridItem.findControl("ddlAssignedTo")
                        if (ddl != null) {
                            if (ddl._uniqueId == combo._uniqueId) {


                                if (ddl.get_items().get_count() == 1) {
                                    $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest("LoadEmployee|" + i);
                                    
                                    break;
                                }
                            }
                        }
                    }
                    return flag;
                }




            }
0
Dimitar Terziev
Telerik team
answered on 30 Apr 2012, 03:30 PM
Hi,

In case the RadComboBox is being updated during an Ajax request, then its drop down could not be left opened during the request. This is caused by the fact that it should be re-initialized which requires to be closed and then re-opened.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Andrew
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Andrew
Top achievements
Rank 1
Shahzada
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or