Can OnClientDropDownOpening Callback to the Server

8 posts, 0 answers
  1. Andrew
    Andrew avatar
    104 posts
    Member since:
    May 2008

    Posted 22 Oct 2008 Link to this post

    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.
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 22 Oct 2008 Link to this post

    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.
  3. Andrew
    Andrew avatar
    104 posts
    Member since:
    May 2008

    Posted 22 Oct 2008 Link to this post

    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?
  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 24 Oct 2008 Link to this post

    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.
  5. Andrew
    Andrew avatar
    104 posts
    Member since:
    May 2008

    Posted 06 Jan 2009 Link to this post

    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
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 09 Jan 2009 Link to this post

    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.
  7. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 27 Apr 2012 Link to this post

    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;
                    }




                }
  8. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 30 Apr 2012 Link to this post

    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.
Back to Top