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

Can't Update Label in RadListView

1 Answer 104 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Beryl
Top achievements
Rank 1
Beryl asked on 19 Feb 2018, 11:22 PM

I am trying to update a RadLabel control that is inside of a RadlistView which is inside of a RadAjaxPanel.  I have a user control on my aspx page that calls a public event handler when a modal on the user control closes.  I can access the RadLabel, but it doesn't update.

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" EnableViewState="false">
                    <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="divNoResults" style="background-color:#ED4B4B;color:white" visible="false"><asp:PlaceHolder ID="noResults" runat="server"></asp:PlaceHolder> </div>
                                    <div class="panel panel-alt3 panel-transparent" style="padding: 0px !important">
                                        <div class="panel-heading panel-heading-cg" style="overflow:visible">
                                            <div class="input-group">
                                                <span runat="server" class="media" id="spFilter" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "activity" ? false : 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">
                                                        <li runat="server" id="btnCustomFilter"><asp:LinkButton runat="server" ID="lnkCustom" OnClick="customFilterLink_ServerClick" OnClientClick="javascript:OpenFilterModal();" >Custom</asp:LinkButton></li>
                                                        <li class="divider"></li>
                                                        <asp:PlaceHolder runat="server" ID="hldFilters"></asp:PlaceHolder>
                                                    </ul>
                                                </span>
                                                <span id="ddlLists" runat="server" visible="false" style="display:inline" >
                                                    <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" >
                                                            <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="333px" ClientIDMode="Static" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnSelectedIndexChanged="cmbTicket_SelectedIndexChanged" AutoPostBack="true" >
                                                            <WebServiceSettings Method="GetTickets" Path="~/Portal/Ajax/COGS.asmx" />
                                                        </telerik:RadComboBox>
                                                    </span>
                                                </span>
                                                <span runat="server" id="spActivity" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "activity" ? true : false %>'>
                                                    Asset&nbsp;&nbsp
                                        <asp:DropDownList runat="server" ID="ddlAssets" ForeColor="Black" Font-Size="Small"></asp:DropDownList>
                                           &nbsp;&nbsp; Date &nbsp;&nbsp;<i class="s7-date" style="font-size:x-large;display:inline"></i><asp:TextBox runat="server" ID="txtReportDate" ClientIDMode="Static" Font-Size="Small" ForeColor="Black" CssClass="datepicker" placeholder="m/d/yyyy" ></asp:TextBox>
                                                    </span>
                                            </div>
                                                <div runat="server" id="SelectedFilter" style="background-color:#fff2d7; color:black;padding-left:10px" ><telerik:RadLabel runat="server" ID="filterName" Font-Size="Small"></telerik:RadLabel></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 EventHandler:

        private void JobFilterControl_CustomJobFilterSaved(object sender, EventArgs e)
        {
            foreach (RadListViewItem item in radlistview1.Items)
            {
                string module = ((HiddenField)item.FindControl("hfModule")).Value;

                RadLabel filterName = item.FindControl("filterName") as RadLabel;

                switch (module)
                {
                    case "JOB":
                        filterName.Text = "Selected Filter: " + Session["SavedJobFilterName"].ToString();
                        break;
                    case "TICKET":
                        filterName.Text = "Selected Filter: All";
                        break;
                }
            }
        }

All of the code works as expected except that the Label Text does not update.  Is there anyting I can do to get this to work?  Any assistance is greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 22 Feb 2018, 08:55 AM
Hi Beryl,

This might be related to the RadAjaxPanel. Please temporarily remove AJAX and see whether the label control is updated as expected:
https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax

Looking forward to hearing from you.

Regards,
Eyup
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.
Tags
ListView
Asked by
Beryl
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or