Try Now
More in this section

Forums / Designing & Styling / Events Widget - No upcoming events message

Events Widget - No upcoming events message

3 posts, 0 answered
  1. David
    David  avatar
    1 posts
    07 Jun 2011
    11 Aug 2011
    Link to this post
    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">
            <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 class="events_pad" />
            <li class="sfeventListItem">
                <h3 class="sfeventTitle">
                    <sf:DetailsViewHyperLink TextDataField="Title" ToolTipDataField="Description" runat="server" />
                <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"/>
                <sf:ContentBrowseAndEditToolbar ID="BrowseAndEditToolbar" runat="server" Mode="Edit,Delete,Unpublish"></sf:ContentBrowseAndEditToolbar>
               No upcoming events.

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

    Your help will be most welcome.

    Thanks in advance,
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    14 Oct 2016
    12 Aug 2011
    Link to this post
    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.

    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
  3. Shannon
    Shannon avatar
    3 posts
    10 Oct 2012
    23 Sep 2014 in reply to Boyan Barnev
    Link to this post

    Has this been fixed as of 7.0?  

3 posts, 0 answered