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

Forums / Developing with Sitefinity / checkbox, dropdown, multiplechoice from form custom binding

checkbox, dropdown, multiplechoice from form custom binding

3 posts, 0 answered
  1. Piotr
    Piotr avatar
    3 posts
    Registered:
    23 Jul 2012
    07 Aug 2012
    Link to this post
    Hi,
    I'm very new to sitefinity and ASP.NET so I have some particular problems with understanding how it works. 
    Let me describe the situation:
    I've got couple of pages on my sitefinity project named test.
    Firstly I created some basic form with checkbox, dropdownList, multiplechoice controls - all of them have default bindings like 'FirstChoice' etc. If I click edit on lets say DropdownList on the bottom is For developer name : FormDropDownList_C001.
    Ok, so I come to home page, drag&drop form, select my created form and it shows up - perfect. Next publish the page...
    Next step is go to visual studio, open the project 'test' and see what I can do with 'FormDropDownList_C001'. Here start problems. In let's say OnPageLoad I can see some 'form1' - guessing it's this form (but named it different). I can never see the generated names like FormDropDownList_C001 and so on..What to do?

    Mainly question is - how to get to this form and it's content (checkboxes etc) and change theirs binding and whatever else?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Aug 2012
    Link to this post
    Hi,

    Since all controls that we have are compiled into assemblies and you don't have direct access to the control template or its code behind there are several options.

    1. Inherit from the base control
    2. Create a custom form control
    3. Use client side api to make changes on the public page.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Piotr
    Piotr avatar
    3 posts
    Registered:
    23 Jul 2012
    10 Aug 2012
    Link to this post
    Hmm ok I created some CaptureForm : FormsControl - as in some example. In this capture form I've got submit.Click event which fires SubmitClick method (based on  http://www.sitefinity.com/devnet/forums/sitefinity/general-discussions/problem-with-checkboxes.aspx ). Ok, so I have some CaptureForm which should take 'parent' form events like Submit.Click ;) Firstly I somehow made something simmilar - I builded ascx and cs files and gave it to Widgets, then imports into sitefinity. Next I drag&dropped in on my page so as I think created some container for forms. Another step was to drag&drop 'Form' on it (not next to it but into it) and select desired form. 
    After this I started my page by running visual studio program and after click submit button I could debug and so on.
    My question is, why now I cannot do this?Everytime I try do drop the 'base' form (lets say that container) I got error that Widget need to inherit UserControl.
    But to take the form events it needs to inherit by FormsControl as I guess.

    If possible would be something like that - I create some simple custom widget which has SubmitClickEvent and so on, just drop it to page and next to it drop some form and the widget would do its stuff.

    Any advice?
3 posts, 0 answered