checkbox, dropdown, multiplechoice from form custom binding

Posted by Community Admin on 04-Aug-2018 10:02

checkbox, dropdown, multiplechoice from form custom binding

All Replies

Posted by Community Admin on 07-Aug-2012 00:00

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?

Posted by Community Admin on 09-Aug-2012 00:00

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

Posted by Community Admin on 10-Aug-2012 00:00

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?

This thread is closed