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

Forums / Developing with Sitefinity / Can´t extend PollItemEdit

Can´t extend PollItemEdit

4 posts, 1 answered
  1. Augusto Radtke
    Augusto Radtke avatar
    24 posts
    Registered:
    16 Apr 2010
    15 Jul 2010
    Link to this post
    Hello, I´m trying to extend the PollItemEdit control to add an expires field on the admin site, so far I tried to do that:

    public class PollItemEdit: Telerik.Polls.WebControls.Admin.PollItemEdit <Telerik.Polls.WebControls.Admin.PollItemsView>

    And the following on ControlsConfig:

    <viewSettings hostType="Telerik.Polls.WebControls.Admin.PollItemEdit`1[[Telerik.Polls.WebControls.Admin.PollItemsView, Telerik.Polls]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Polls/PollItemEdit.ascx">
        <views>
          <remove name="PollItemEdit`1"/>
          <add name="PollItemEdit`1" viewType="QUAY.Sitefinity.Poll.Admin.PollItemEdit, QUAY.Sitefinity.Poll"></add>
        </views>
      </viewSettings>

    But I´m getting the following error no the admin:

    Unable to cast object of type 'Telerik.Polls.WebControls.Admin.PollItemEdit`1[Telerik.Polls.WebControls.Admin.PollItemsView]' to type 'Telerik.Polls.WebControls.Admin.PollItemsView'.


    Does anyone know how to solve this problem? This method works fine for other parts of the admin, like the library but isn´t working as expected for the Poll module.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    15 Jul 2010
    Link to this post
    Hello Augusto Radtke,

    The host type is "Telerik.Polls.WebControls.Admin.PollItemsView"

    <viewSettings  hostType="Telerik.Polls.WebControls.Admin.PollItemsView">
          <views>
            <remove name="PollItemEdit`1"/>
            <add name="PollItemEdit`1" viewType=".........."></add>
          </views>
        </viewSettings>


    Greetings,
    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
    Answered
  3. Augusto Radtke
    Augusto Radtke avatar
    24 posts
    Registered:
    16 Apr 2010
    15 Jul 2010
    Link to this post
    Thank you Ivan, but not all the templates changed, and I can´t even list the polls anymore, there is any hostType that is more selective about that?
  4. Augusto Radtke
    Augusto Radtke avatar
    24 posts
    Registered:
    16 Apr 2010
    15 Jul 2010
    Link to this post
    Actually, I made it work, forgot about removing the layoutTemplatePath that was on <viewSettings>
Register for webinar
4 posts, 1 answered