More in this section

Forums / Developing with Sitefinity / Get current content item from field control?

Get current content item from field control?

2 posts, 0 answered
  1. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    24 Feb 2013
    Link to this post

    I am creating a field control and would like to simply display the ID of the current content item being worked on (the item that is bound to the field control). I cannot find a reference to the content item anywhere in "this" or "container". Any ideas on how to get this?

    public class ControlUsage : FieldControl
    {
        ...
     
        protected override void InitializeControls(GenericContainer container)
        {
            this.TextBoxControl.Text = //CURRENT CONTENT ITEM ID???
        }
    }

  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    27 Feb 2013
    Link to this post
    Hi Basem,

    I have studied our current implementation, but unfortunately there is no easy way to get the desired object's ID to display. You can use the OriginalContentID property for the item, however there is no suitable event to bind to, from which you can extract the temp version of the item.

    All the best,
    Victor Velev
    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