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

Forums / Designing with Sitefinity / Discovering what's in the DataSource

Discovering what's in the DataSource

9 posts, 2 answered
  1. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    Registered:
    07 Jul 2004
    13 May 2010
    Link to this post
    As you may know, I'm modifying some of the templates and am adding/moving/deleting things.

    I'm using constructs like...

    <%# DateTime.Parse(DataBinder.Eval(Container.DataItem, "Event_End").ToString()).ToString("dd MMM yyyy HH:mm")%>

    To get at the data. Thing is I'm currently guessing at what the data fields are called. Is there somewhere I can find out what they are for each of the modules? Or do I need to dig about in the DB?

    -- 
    Stuart (who is having great fun learning about Sitefinity)
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    13 May 2010
    Link to this post
    Hello Stuart Hemming,

    In the Generic Content based modules the databinder which binds the back-end views gets the fields from each modules meta field collection. You can take a look at the <metafields> configuration section in your web.config to find out what meta fields are available for each module. We use Client Side Databinding to bind the grid. You can find more information on how to utilize this if you have your own fields here.

    Regards,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
  3. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    Registered:
    07 Jul 2004
    13 May 2010
    Link to this post
    Radoslav,

    Thanks for that; it's also obvious once its pointed out to you, isn't it? :-)

    Thanks also for the pointer for adding my own fields; that would otherwise have been a question later.

    Just one follow up, how do access the data in the single item view? Obviously, there's no Repeater so there's no DataItem. The reason for this question is that I want to change the way the dates are formatted (as well as other things).

    TVM.

    -- 
    Stuart
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    13 May 2010
    Link to this post
    Hello Stuart Hemming,

    If you are talking about the the content view controls (News View, Content View, Blog Posts, etc. public controls) look for ITextControls in the control template with the same IDs as the meta fields. So say that for news you have Publication_Date field. Then when you are viewing a single news item in the public end of the website the news view control will see if there is a control with the same ID="Publication_Date" and set its text to be the same as the value of the meta field. This goes for custom fields too. You just have to add an ITextControl with the same ID.

    Formatting date time works the same way as in ASP.NET, formats can be found here.  You just have to add your format:
    <asp:Literal ID="Publication_Date" runat="server" Text="{YourFormatHere}" />
     

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
  5. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    Registered:
    07 Jul 2004
    13 May 2010
    Link to this post
    Top Lad!

    It's nice to know that the high level of service isn't limited to the ASP.NET guys.

    You guys have got me a long way to getting this site finished from a standing start.

    Thanks again.

    -- 
    Stuart
  6. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    Registered:
    07 Jul 2004
    13 May 2010
    Link to this post
    Hmmm.

    As you can see from ss1.jpg I've done as you suggested. I've added a couple of characters before the Literal control to prove that I am, in fact, modifying the right one, but when I view the page, I get ss2.jpg.

    It doesn't appear to matter what format string I use I seem to get output formatted, if memory serves, using the "D" standard format.

    -- 
    Stuart
  7. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    Registered:
    07 Jul 2004
    13 May 2010
    Link to this post
    Oops. Here are the files.

    -- 
    Stuart
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    13 May 2010
    Link to this post
    Hello Stuart Hemming,

    Try using this way - Display Times in EventView. This should work.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. Stuart Hemming
    Stuart Hemming avatar
    144 posts
    Registered:
    07 Jul 2004
    13 May 2010
    Link to this post
    Ha-ha!

    Nice one.

    On we go...
    -- 
    Stuart


Register for webinar
9 posts, 2 answered