+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Events Module

Events Module

2 posts, 0 answered
  1. Asif
    Asif avatar
    110 posts
    Registered:
    18 Nov 2010
    06 May 2011
    Link to this post
    Hi,
    I want to show events similar like this . I have put my code which i am using to achieve below functionality. The issue I am facing is to format Date because the out put I am getting for date is "5/31/2011 12:00:00 AM" and I want it to look like "May 31,2001". Also, I couldn't find any property for showing city. Please help.
    1. Events Title

     

    Date:                April 24, 2011

    Time:                12:00pm – 3:00pm

    Location:           Vancouver, B.C.

    For that, I am using this code in back end
    // create new instance of EventsManager
           Telerik.Events.EventsManager eventsManager = new Telerik.Events.EventsManager("Events");
           // get all events
           IList listOfAllEvents = eventsManager.GetEvents();
           if (listOfAllEvents.Count > 0)
           {
     
               repeater1.DataSource = listOfAllEvents;
               repeater1.DataBind();
              
           }
     and this code in front end
    <asp:Repeater ID="repeater1" runat="server">
     <HeaderTemplate>
        <ol class="sf_eventsList">
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <h2 class="sf_eventTitle">
                    <asp:HyperLink ID="fullContent1" runat="server">
                        <asp:Literal ID="something" runat="server" Text='<%# Eval("EventTitle") %>'/>
                    </asp:HyperLink>
                </h2>
                <div id="EventFields">
                    <div class="EventLabel"><p>Date:</p></div>
                    <div class="EventValue"><p><asp:Literal ID="Literal1" runat="server" Text='<%# Eval("Start.Date") %>'/></p></div>
                    <div class="clear"></div>
                    <div class="EventLabel"><p>Time:</p></div>
                    <div class="EventValue"><p><asp:Literal ID="Literal2" runat="server" Text='<%# Eval("Start.TimeOfDay") %>'/> - <asp:Literal ID="Literal4" runat="server" Text='<%# Eval("End.TimeOfDay") %>'/></p></div>
                    <div class="clear"></div>
                    <div class="EventLabel"><p>Location:</p></div>
                    <div class="EventValue"><p><asp:Literal ID="Literal3" runat="server" Text='<%# Eval("EventTitle") %>'/></p></div>
                </div>
              
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ol>
        </FooterTemplate>
    </asp:Repeater>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 May 2011
    Link to this post
    Hello Asif,

    You should use the metakeys of the evens which are declared in the web.config
    You have to get a metakey using GetMetaData method of the content item and set this value to your presentation controls

    <add key="Events.Title" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
        <add key="Events.Street" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
        <add key="Events.City" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
        <add key="Events.Country" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
        <add key="Events.State" valueType="ShortText" visible="True" searchable="True" sortable="False" defaultValue=""/>
        <add key="Events.Geomapping_Data" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/>
        <add key="Events.Event_Start" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/>
        <add key="Events.Event_End" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/>
        <add key="Events.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/>
        <add key="Events.Expiration_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Max"/>
        <add key="Events.Contact_Name" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/>
        <add key="Events.Contact_Email" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/>
        <add key="Events.Contact_Phone" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/>
        <add key="Events.Contact_Cell" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/>
        <add key="Events.Contact_Web" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/>
        <add key="Events.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>


    Kind regards,
    Ivan Dimitrov
    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
2 posts, 0 answered