More in this section

Forums / Developing with Sitefinity / Generic Content in User Control

Generic Content in User Control

2 posts, 0 answered
  1. Juliana
    Juliana avatar
    2 posts
    Registered:
    05 Feb 2008
    24 Mar 2010
    Link to this post
    Hi, Telerik

    I wrote user control which implement IContentContainer interface. Also I have some public string properties, in order to display text outside generic control. But when I try to style displaing text in generic content (like setting paragraphs or making it bold), I can't edit my public string properties any more.

    What am I doing wrong?

    public partial class ChildrenControl : UserControl, IContentContainer
        {
            #region IContentContainer Members

            [Browsable(false)]
            [Telerik.Cms.Web.UI.WebEditor("Telerik.Cms.Engine.WebControls.HtmlContentEditor, Telerik.Cms.Engine")]
            [TypeConverter(typeof(StringConverter))]
            public object Content
            {
                get
                {
                    return this.GenericContent1.Content;
                }
                set
                {
                    this.GenericContent1.Content = value.ToString();
                }
            }

            [Browsable(false)]
            public string ProviderName
            {
                get
                {
                    return this.GenericContent1.ProviderName;
                }
                set
                {
                    this.GenericContent1.ProviderName = value;
                }
            }

            #endregion

            [Category("Form Text")]
            public string CellInfo
            {
                get
                {
                    return lCellInfo.Text;
                }
                set
                {
                    lCellInfo.Text = value;
                }
            }
    }
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    24 Mar 2010
    Link to this post
    Hi Juliana,

    You need to implement a custom control as described in this KB article - Wrap GenericContent control in Sitefinity 3.6 SP1

    Best wishes,
    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.
2 posts, 0 answered