Get current content item from field control?

Posted by Community Admin on 04-Aug-2018 16:52

Get current content item from field control?

All Replies

Posted by Community Admin on 24-Feb-2013 00:00

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???
    

Posted by Community Admin on 27-Feb-2013 00:00

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

This thread is closed