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

Forums / Bugs & Issues / How to know the ContainerID

How to know the ContainerID

6 posts, 0 answered
  1. Katherine
    Katherine avatar
    4 posts
    Registered:
    10 Jun 2009
    23 Dec 2009
    Link to this post
    Hi,

    We've got some control with custom control Designer. Within  the protected override void InitializeControls(Control viewContainer) method we need to know what container (placeholder) the designed control belongs to?

    Please advise.

    Also please advise how to customize the Generic Content to preview the Edited markup styled properly (as final styles). The same tags could be look like differently within different content place holders.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Dec 2009
    Link to this post
    Hi Katherine,

    The container and placeholder are two different things. The control does not know about the ControlDesigner, since the ControlDesigner can have a reference to the custom control. The ControlDesigner and your control could have containers that just collects controls, so you do not have to use recursion to find them.

    The ConentPlaceHolder is declared in the master page and it collects controls. You can find each contorol on a page by getting the page controls collection.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Katherine
    Katherine avatar
    4 posts
    Registered:
    10 Jun 2009
    23 Dec 2009
    Link to this post
    Thank you Ivan,

    but I've mentioned some another point.
    Is it possible to know which placeholder control belongs to when the control is being designed?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Dec 2009
    Link to this post
    Hi Katherine,

    Could you describe a bit more. The "Is it possible to know which placeholder control belongs to when the control is being designed?" does not make any sense to us.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Katherine
    Katherine avatar
    4 posts
    Registered:
    10 Jun 2009
    23 Dec 2009
    Link to this post
    Hi Ivan,
    Ok, we are looking for workaround to make the Generic Content control's content looks the same as at the endpoint page. But some styles depend on control container style.

    We haven't found any information how to customize the Generic Content control easily and flexibly.
    Please advise, since it is a strong requirement.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Dec 2009
    Link to this post
    Hi Katherine,

    The content of GenericContent control is actually the RadEditor.Content. The GenericContent class uses Render method to show the entered content. If you want to modify the control you need to follow the steps below:

    1. Create a Custom class that inherits from GenericContent
    2. Create a control designer that inherits from GenericContentDesigner
    3. Then you can override Render method of your class that inherits from GenericContent and change the final output. For rendering text content  the following method is  used RenderTextContent

    You may find the following KB article useful.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
6 posts, 0 answered