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

Forums / Bugs & Issues / Events View: Displays Publication Date, not Event Start Date...ignores Description

Events View: Displays Publication Date, not Event Start Date...ignores Description

10 posts, 0 answered
  1. Dan Humiston
    Dan Humiston avatar
    4 posts
    Registered:
    21 Jul 2009
    05 Aug 2009
    Link to this post
    Having some trouble with the Event List when I use the Events View control in SiteFinity v3.6 (SP 2, I think).

    Issue 1: 
    When I check the box for the Event Start Date, it displays the publication date instead.  This is a huge problem, because it makes it look like all of our events happened a couple of weeks ago (which is when we entered the content).  If we change the publication date to match the event start, the event does not publish (of course) until the date of the event.
    Unchecking Start Date, Checking  End Date:  No difference.  Still displays publication date.
    Unchecking Both Start Date and End Date:  No differenct.  Still displays publication date.

    Issue 2:  
    Does not display Summary or Content.

    Need help please.  This site is due to go live Friday 8/7!

    Dan 
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Aug 2009
    Link to this post
    Hello Dan Humiston,

    Thank you for your question.
    I was able to reproduce the problem in the following way:
    1. Created an event
    2. Dragged the EventsView control. By default, the control is showing the publication date.

    To show the actual Event Start and Event end dates, please do the following.
    1. Open the control in Edit mode
    2. Go to step 3, and check the Event end box. 
    3. You should now see the Event Start and event end dates.
    4. Save the page.

    Let me know if this helps. As for the content property, it is always shown on my side. Can you please provide us with screenshots?

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Dan Humiston
    Dan Humiston avatar
    4 posts
    Registered:
    21 Jul 2009
    10 Aug 2009
    Link to this post
    Thanks for your response.  Sadly, that's not working for me.  I can check End Date by itself, Start Date and End Date, or just Start Date, and the results are the same.  Only the publication date is getting displayed...start date, end date, and content / summary do not get displayed.

    Just to be clear:
    -the Event Details page is displaying the event properly:
    -the problem with the wrong date is in the Events List:
    -No matter what combination of check boxes I use for the Events List

    You can see a screenshot of my settings here.
    You can see the resulting page here:  https://preview.pfcu.com/retirees_events-view-bug-reference.aspx.

    Thanks again for help with this matter.

    Dan
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    13 Aug 2009
    Link to this post
    Hi Dan,

    I will try to spend some more time in looking for what is wrong. In the meantime, you can implement the following control:

    1. App_Code\CustomEventsView.cs:
    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Web; 
    using Telerik.Events.WebControls; 
    using Telerik.Cms.Web.UI; 
     
    namespace Sitefinity.Samples 
        /// <summary> 
        /// Summary description for CustomEventsView 
        /// </summary> 
        public class CustomEventsView : EventsView 
        { 
            protected override void SetItemMetadata(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem) 
            { 
                //this method is called for each item in the events list. 
                base.SetItemMetadata(itemContainer, contentItem); 
                DateTimeLiteral dtLiteral = base.FindControl("Publication_Date"as DateTimeLiteral; 
                dtLiteral.Date = (DateTime)contentItem.GetMetaData("Publication_Date"); 
                //you can do the same for the rest of the fields that you need. 
                //ContentItem.Content is the content of the event 
            } 
            public override Type AssemblyInfo 
            { 
                get 
                { 
                    return typeof(EventsView); 
                } 
                set 
                { 
                    base.AssemblyInfo = value; 
                } 
            } 
            public override Type LocalizationAssemblyInfo 
            { 
                get 
                { 
                    return typeof(EventsView); 
                } 
                set 
                { 
                    base.LocalizationAssemblyInfo = value; 
                } 
            } 
        } 
     

    2. Register in the web.config:
       <toolboxControls> 
            <clear /> 
            <add name="CustomEventsView" section="New" type="Sitefinity.Samples.CustomEventsView, App_Code" /> 

    Note that you can pull any of the content items metafield and assign them to the appropriate controls.

    If you need to override the events view for the event details, this is the method that should be overriden:
            protected override void SetSingleItemContent(Telerik.Cms.Engine.IContent item) 
            { 
                base.SetSingleItemContent(item); 
            } 

    Again, I will spend some more time and find the problem. Then I will come back to you. By the way, I was using the built-in templates when I was testing.


    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Dan Humiston
    Dan Humiston avatar
    4 posts
    Registered:
    21 Jul 2009
    13 Aug 2009
    Link to this post
    Thanks, Georgi!  I'll give this a try.
  6. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    16 Aug 2009
    Link to this post
    What I have also notice, I cannot locate the Events - ListPageMaster or Details file. Please assist with some directions on locating these files.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Aug 2009
    Link to this post
    Hi warfee,

    Presentation Mode templates are located under [Sitefinity_3_7_1990_standard_ExternalTemplates]/Sitefinity/Admin/ControlTemplates/Events/Modes.

    In the sample code provided you can override SingleItemTemplatePath and ItemListTemplatePath properties and set the templates.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. warfee
    warfee avatar
    27 posts
    Registered:
    10 Aug 2007
    18 Aug 2009
    Link to this post
    Thanks..found.
  9. Dan Humiston
    Dan Humiston avatar
    4 posts
    Registered:
    21 Jul 2009
    17 Sep 2009
    Link to this post
    Hey, Georgi -

    Thanks again for your help on this item.  Just now able to circle back to this item. 

    We've uploaded and implemented the control following your instructions verbatim.  We can drop the control into a page and edit/save its properties.  After saving, we get the message "Object reference not set to an instance of an object." inside the container.  And if we surf to our test page we get .NET error:

    Test Page URL:  http://pfcu-dev.priorityresults.net/TestPages/EventsListControl.aspx

    Server Error in '/' Application. 
    Object reference not set to an instance of an object. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
     
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. 
     
    Source Error: 
     
    Line 18:             base.SetItemMetadata(itemContainer, contentItem); 
    Line 19:             DateTimeLiteral dtLiteral = base.FindControl("Publication_Date") as DateTimeLiteral; 
    Line 20:             dtLiteral.Date = (DateTime)contentItem.GetMetaData("Publication_Date"); 
    Line 21:             //you can do the same for the rest of the fields that you need.  
    Line 22:             //ContentItem.Content is the content of the event  
     
     
    Source File: c:\web\LocalUser\PFCU2\www\App_Code\CustomEventsView.cs    Line: 20 
     
    Stack Trace: 
     
    [NullReferenceException: Object reference not set to an instance of an object.] 
       Sitefinity.Samples.CustomEventsView.SetItemMetadata(Control itemContainer, IContent contentItem) in c:\web\LocalUser\PFCU2\www\App_Code\CustomEventsView.cs:20 
       Telerik.Cms.Engine.WebControls.ContentView.repeater_ItemDataBound(Object sender, RepeaterItemEventArgs e) +404 
       System.Web.UI.WebControls.Repeater.OnItemDataBound(RepeaterItemEventArgs e) +108 
       System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +136 
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +443 
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +51 
       System.Web.UI.WebControls.Repeater.DataBind() +75 
       Telerik.Cms.Engine.WebControls.ContentView.CreateChildControls() +4852 
       Telerik.Events.WebControls.EventsView.CreateChildControls() +62 
       System.Web.UI.Control.EnsureChildControls() +87 
       System.Web.UI.Control.PreRenderRecursiveInternal() +44 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 
     
     
    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082  


    Again, we followed your instructions verbatim.  Is there anything we are missing?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Sep 2009
    Link to this post
    Hi Dan Humiston,

    Most probably one of the controls - dtLiteral  is not found and it throws object reference error. You can attache the code to a debugger and see from where the exact error comes from.

    If this is the control - dtLiteral , you can try to get it from the itemContainer controls collection.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
10 posts, 0 answered