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

SelectedIndexChanged Event of RadComboBox in RadListView not firing

2 Answers 211 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Beryl
Top achievements
Rank 1
Beryl asked on 10 Jan 2018, 09:58 PM

I have a RadComboBox inside a RadListView.  When selected an item in the list, the SelectedIndexChanged event does not fire.  Here is my HTML:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" BackColor="White">
                <div class="form-group">
                        <asp:RadioButtonList ID="radioChoice" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" CssClass="inline-rb" OnSelectedIndexChanged="radioChoice_SelectedIndexChanged">
                            <asp:ListItem Value="Multiple" Text="Multiple Record Report" Selected="True" />
                            <asp:ListItem Value="Single" Text="Single Record Report" />
                        </asp:RadioButtonList>
                    </div>
                <asp:HiddenField runat="server" ID="panelCollapse" ClientIDMode="Static" />
                <asp:HiddenField runat="server" ID="SelectedItem" />
                <hr />
               
                <telerik:RadListView runat="server" ID="radlistview1" OnItemDataBound="radlistview1_ItemDataBound" >
                    <ItemTemplate>
                        <div class="panel panel-default">
                            <div class="panel-heading" style="border:none; padding:0px !important">
                                <h4 class="panel-title">
                                    <a data-toggle="collapse" href="#pnl<%#Eval("ModuleDataKey") %>" rel="popover" data-placement="top" data-content="Click to expand/collapse report list" data-trigger="hover"><i class="s7-plus"></i></a>&nbsp;<%#Eval("ModuleDataKey") %>
                                </h4>
                            </div>
                            <div id='pnl<%#Eval("ModuleDataKey") %>' class="panel-collapse collapse">
                                <div class="panel-body" style="padding:0px !important 10px 0px 10px">
                                    <div runat="server" id="multiDirections" visible="true" class="message">Click the Filter icon to select the data filter for your report and then click on the desired report.</div>
                                    <div runat="server" id="singleDirections" visible="false" class="message">Click the dropdown list to select the item for your report and then click on the desired report.</div>
                                    <div runat="server" id="noResults" style="background-color:#ED4B4B;color:white" visible="false"><asp:Label runat="server" ID="lblNoResults"></asp:Label></div>
                                    <div class="panel panel-alt3 panel-transparent" style="padding: 0px !important">
                                        <div class="panel-heading panel-heading-cg">
                                            <div class="input-group">
                                                <span runat="server" id="spFilter" visible="true">
                                                    <button type="button" data-toggle="dropdown" title="Filter List" class="btn btn-alt3"  id="btnFilter" runat="server"><i class="icon icon-left s7-filter"></i><span class="caret"></button>
                                                    <ul role="menu" class="dropdown-menu">
                                                        <asp:PlaceHolder runat="server" ID="hldFilters"></asp:PlaceHolder>
                                                    </ul>
                                                </span>
                                                               <span id="ddlLists" runat="server" visible="false" style="display:inline" >
<%--                                                    <asp:PlaceHolder runat="server" ID="moduleList"></asp:PlaceHolder>--%>
                                                    <span runat="server"  id="spJobDropDown" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "job" ? true : false %>'>
    
                                                        <telerik:RadComboBox DropDownAutoWidth="Enabled" RenderMode="Lightweight" ID="qfTicket_cmbJob" EmptyMessage="Type to Select..." runat="server" Width="500px" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnSelectedIndexChanged="qfTicket_cmbJob_SelectedIndexChanged" AutoPostBack="true">
                                                            <WebServiceSettings Method="GetJobs" Path="~/Portal/Ajax/COGS.asmx" />
                                                        </telerik:RadComboBox>

                                                    </span>
                                                    <span runat="server" id="spTicketDropdown" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "ticket" ? true : false %>'>
      
                                                        <telerik:RadComboBox DropDownAutoWidth="Enabled" RenderMode="Lightweight" ID="cmbTicket" EmptyMessage="Type to Select..." runat="server" Width="500px" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnSelectedIndexChanged="cmbTicket_SelectedIndexChanged" AutoPostBack="true">
                                                            <WebServiceSettings Method="GetTickets" Path="~/Portal/Ajax/COGS.asmx" />
                                                        </telerik:RadComboBox>
                                      
                                                    </span>
                                                </span>
                                            </div>
                                            <div runat="server" id="SelectedFilter" style="background-color:#fff2d7; color:black;padding-left:10px" ><asp:Label runat="server" ID="filterName" Font-Size="Small"></asp:Label></div>
                                        </div>
                                        <div class="panel-body" style="padding-top:10px">
                                            <br />
                                            <asp:HiddenField ID="hfModule" Value='<%#Eval("ModuleDataKey") %>' runat="server" />
                                            <asp:PlaceHolder ID="phRow" runat="server"></asp:PlaceHolder>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </ItemTemplate>
                </telerik:RadListView>
    

            </telerik:RadAjaxPanel>

Here is my code behind:

        protected void qfTicket_cmbJob_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((CG.Portal.Web.DesktopMaster)Page.Master).ClearMessage();
            IdentifierId = e.Value;
        }

        protected void cmbTicket_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((CG.Portal.Web.DesktopMaster)Page.Master).ClearMessage();
            IdentifierId = e.Value;

        }

 

Any assistance is greatly appreciated!

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 15 Jan 2018, 01:19 PM

Hello Beryl,

Could you attach a breakpoint to the method and see if it fires? Considering that the listview is in a RadAjaxPanel, it will do a partial postback and the server response will only contain the listview, and will not contain the other parts of the master page, and this can make it seem like the event does not fire.

I'm attaching here a simplified version of this that works as expected. I removed most of the fields and the template for simplicity, and I used a page method for the dummy load-on-demand for the combo.

If that's not your case, can you show me what is the difference with this sample that causes the problem?

Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Eric
Top achievements
Rank 1
answered on 13 May 2019, 02:38 PM
For someone else who comes across this...I have found that selectedindexchanged does not fire inside RadAjaxPanel.  Take it outside of the radajaxpanel and it should work. 
Tags
ComboBox
Asked by
Beryl
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Eric
Top achievements
Rank 1
Share this question
or