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

Forums / Developing with Sitefinity / List of Items in Control Designer

List of Items in Control Designer

5 posts, 0 answered
  1. Casey
    Casey avatar
    25 posts
    Registered:
    22 Oct 2010
    23 Mar 2011
    Link to this post
    I have a property on a control that stores a list of items to show in a carousel. I'm trying to create a control designer that allows the editor to add new items to the carousel.

    When the editor clicks add in the control designer then a new user control is added to the designer that has some textboxes. What I can't figure out is how can I get the values that the editor enters into the newly added control. If I attempt to get the values during OnSaving then the newly added control has already been removed so I can't access the values. Same thing if I add my own "Update" button. What event can I use to get the editor's values from the new control?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Mar 2011
    Link to this post
    Hi Casey,

    You need to add some event like DataChanged in your custom designer. When you add some data to the control you need to set it as a property of your control which should ensure that this data will be persisted.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  3. Casey
    Casey avatar
    25 posts
    Registered:
    22 Oct 2010
    23 Mar 2011
    Link to this post
    That seems like it would work so i added an "update" button to the designer and in it's click event i want to update the control property but the newly added control that the editor has made changes to no longer exists by the time the click handler fires. i'm not sure how else to implement the "DataChanged" event you mentioned. The editor will be typing in textboxes.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Mar 2011
    Link to this post
    Hi Casey,

    Inside InitializeControls/CreateChildControls you should have all control properties

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  5. Casey
    Casey avatar
    25 posts
    Registered:
    22 Oct 2010
    23 Mar 2011
    Link to this post
    Thanks, yeah i have access to the control that the designer is editting. so i can set its properties but i want to set its properties to the values that the editor just entered into a control that i dynamically added to the designer, but that dynamically added control (on the designer) is no longer available before any event (i've tried) can access it (such as OnSaving or a button click handler).

    if i could access the values the editor entered, then i could save them to a control property.

    so how do i grab the editor's entered values from the dynamically added control in the designer? if that's possible
Register for webinar
5 posts, 0 answered