Events Widget - No upcoming events message - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Events Widget - No upcoming events message

  • Events Widget - No upcoming events message
  • Hi all,

    I am stuck and need some help. Is there a way to set up an events list template in the Events widget so that it will display a message on a web page if there are no upcoming events? Currently I am trying to add EmptyDataTemplate block to the template, without success.The text in the template does not display if there are no events. Here's the template in question:

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

    <telerik:RadListView ID="eventsList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="true">
        <LayoutTemplate>
            <sf:ContentBrowseAndEditToolbar ID="MainBrowseAndEditToolbar" runat="server" Mode="Add"></sf:ContentBrowseAndEditToolbar>
            <div class="sfeventsList sfeventsListTitleCityDate" style="list-style:none">
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </div>
            <div class="events_pad" />
        </LayoutTemplate>
        <ItemTemplate>
            <li class="sfeventListItem">
                <h3 class="sfeventTitle">
                    <sf:DetailsViewHyperLink TextDataField="Title" ToolTipDataField="Description" runat="server" />
                </h3>
                <div class="sfeventMetaInfo">
                    <sf:FieldListView ID="where" runat="server"
                        Text="0 | " Properties="City"   />
                    <sf:FieldListView ID="EventsDates" runat="server" />
                    <sf:CommentsBox ID="itemCommentsLink" runat="server" CssClass="sfeventCommentsCount"/>
                </div>
                <sf:ContentBrowseAndEditToolbar ID="BrowseAndEditToolbar" runat="server" Mode="Edit,Delete,Unpublish"></sf:ContentBrowseAndEditToolbar>
            </li>
        </ItemTemplate>
        <EmptyDataTemplate>
               No upcoming events.
        </EmptyDataTemplate>

    </telerik:RadListView>
    <sf:Pager id="pager" runat="server"></sf:Pager>

    Your help will be most welcome.

    Thanks in advance,
    Igor
  • 292181_EventsListEmptyData.rar
    Hello Igor,

    We have replied to you in the support thread you have opened, please check our response there. For your convenience I'm pasting my response below:

    "You can create an external template for the events widget, and subscribe to the Page_PrRender event in the codebehind to check whether the count of the items in your RadListView is 0, if so you can conditionally display/set visibility of the desired text. I'm attaching the template that I've used for your reference."

    Big thanks to Steve McNiven-Scott, who brought our attention on the necessity to have such a feature we have logged this as a task for the upcoming releases. You can check the initial discussion on the topic on this forum thread.

    Greetings,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Has this been fixed as of 7.0?