RadCombobox closing when select a Row from RadGrid

3 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    87 posts
    Member since:
    Oct 2012

    Posted 21 Jun 2011 Link to this post

    I have placed my radGrid inside a Radcombobox but I try to open a radcombobox by calling OnClientDropDownOpening="OnClientDropDownOpening" using ajax request it gets closed automatically.

     function OnClientDropDownOpening(sender, args) {
                var comboText = sender.get_text();
                if (comboText.length > 2) {
                     $find("<%= rapJob.ClientID %>").ajaxRequest("LoadFilteredData," + comboText);
                }
                else {
                    args.set_cancel(true);
                }
            }

     Protected Sub rapJob_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)


            Dim rgJob As RadGrid = TryCast(rcbJob.Items(0).FindControl("rgJob"), RadGrid)
            If e.Argument.IndexOf("LoadFilteredData") <> -1 Then
                rgJob.Rebind()
            End If


        End Sub


        Protected Sub rgJob_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)


            Dim rgJob As Telerik.Web.UI.RadGrid = source


            Dim IJobs = (From Jobs In dbContext.FF_Jobs Where Jobs.IsCreated = True And Jobs.IsCancelled = False And Jobs.IsTemplate = False
                        Select Jobs).ToList


            rgJob.DataSource = IJobs


        End Sub

    <telerik:RadAjaxPanel ID="rapJob" RequestQueueSize="5" runat="server" Width="100%"
                   OnAjaxRequest="rapJob_AjaxRequest" EnableOutsideScripts="True" HorizontalAlign="NotSet"
                   ScrollBars="None" LoadingPanelID="alpJob">
                   <telerik:RadComboBox ID="rcbJob" EmptyMessage="- please select job -" runat="server"
                       OnClientDropDownOpening="OnClientDropDownOpening" MarkFirstMatch="True" Width="300px"
                       Skin="Vista" AutoPostBack="True" AutoCompleteSeparator="true" Filter="Contains"
                       AllowCustomText="true">
                       <ItemTemplate>
                           <div>
                               <telerik:RadGrid ID="rgJob" runat="server" Width="95%" Skin="Vista" AutoGenerateColumns="False"
                                   AllowSorting="True" AllowMultiRowSelection="False" OnNeedDataSource="rgJob_NeedDataSource"
                                   AllowPaging="True" GridLines="Both" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
                                   <PagerStyle Mode="NumericPages"></PagerStyle>
                                   <MasterTableView Width="100%" DataKeyNames="ID,JobName" Name="rgJob" CommandItemDisplay="None" NoMasterRecordsText=""   >
                                       <Columns>
                                           <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton"
                                               DataField="ID" UniqueName="ID" ReadOnly="true">
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn SortExpression="JobName" HeaderText="Job Name" HeaderButtonType="TextButton"
                                               DataField="JobName" UniqueName="JobName">
                                           </telerik:GridBoundColumn>
                                       </Columns>
                                   </MasterTableView>
                                   <ClientSettings EnableRowHoverStyle="true">
                                       <Selecting AllowRowSelect="true" />
                                       <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                   </ClientSettings>
                               </telerik:RadGrid>
                           </div>
                             
                       </ItemTemplate>
                       <Items>
                           <telerik:RadComboBoxItem runat="server" Text=" "></telerik:RadComboBoxItem>
                       </Items>
                   </telerik:RadComboBox>
               </telerik:RadAjaxPanel>

  2. Shahzada
    Shahzada avatar
    22 posts
    Member since:
    Jan 2012

    Posted 27 Apr 2012 Link to this post

    have you done this problem? or not
    i am currently facing this issue

    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 open after rebind radcombobox.

  3. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 01 May 2012 Link to this post

    Hello,

    This behavior of RadComboBox is normal since whenever you try to open the drop-down list the event is either terminated or there is a trip to the server after which the RadComboBox renderer with its drop-down closed.

    If you want to learn more about the client API of the control, refer to the following documentation:  http://www.telerik.com/help/aspnet-ajax/combobox-client-side-basics.html.

    All the best,
    Ivana
    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