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

Forums / Sitefinity SDK / Custom Generic Content

Custom Generic Content

2 posts, 0 answered
  1. Jerami Tainter
    Jerami Tainter avatar
    27 posts
    Registered:
    29 Oct 2009
    25 Nov 2010
    Link to this post
    In 3.7 it took me some time to create a Generic Content Item with my own wrapper and an extra field...basically my Generic Content User Control will contain a title and a HTML Editor...My class looks like:

    public partial class UserControls_Generic_Content_RogueContent : System.Web.UI.UserControl
    {
        [Category("Rogue Data")]
        public string Title { get; set; }

        [Category("Rogue Data")]
        public string Content { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            TitleLabel.Text = Title;
            ContentLabel.Text = Content;
        }
    }

    Simple...So if I go to my Page Editor and drag the control onto the page and Edit I will see two user configurable fields Title and Content...but my problem is Content is just a text box and I would love to be able to specify in the code behind to use the WYSIWYG Editor instead? Is there an easy way to do this or do I need to create a Custom View Template like in 3.7?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    25 Nov 2010
    Link to this post
    Hello Jerami,

    You can use ContentBlock control which wraps RadEditor control. If you want to use a user control you cannot use the RadEditor in the context of a ControlDesigner. In this case you will need a custom control with a custom control designer. The control should inherit from SimpleView( if you do no intend to reuse one of the built-in controls as a basis). The control designer should inherit from ControlDesignerBase.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered