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

RadCombobox closing when select a Row from RadGrid

2 Answers 65 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 21 Jun 2011, 03:15 PM
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 Answers, 1 is accepted

Sort by
0
Shahzada
Top achievements
Rank 1
answered on 27 Apr 2012, 08:07 AM
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.

0
Ivana
Telerik team
answered on 01 May 2012, 01:15 PM
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.
Tags
ComboBox
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Shahzada
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or