RadioButtonList in Custom Module

Posted by Community Admin on 03-Aug-2018 20:02

RadioButtonList in Custom Module

All Replies

Posted by Community Admin on 26-Feb-2011 00:00

Hello,

I'm following the documentation "How to create a basic module" to crate a custom simple module.

I added a RadioButtonList in the module widget but it is not rendered. I see a blank block other than the radio buttons.

Any suggestion?

Thank you

Posted by Community Admin on 28-Feb-2011 00:00

DropDownList is not rendered as well.

No problems with RadComBox, asp:textbox or asp:RadioButton. But I couldn't manage to work with DropDownList and RadioButtonList.

Posted by Community Admin on 02-Mar-2011 00:00

Hello Oguz,

Thank you for contacting Telerik Support.

Where do you add these controls? If possible please attach the project. You can try and use

Telerik.Sitefinity.Web.UI.Fields.ChoiceField


which gives you a wide variety of choice fields to implement:

case RenderChoicesAs.CheckBoxes: 
  
return this.CheckBoxes;
  
case RenderChoicesAs.DropDown:
  
return this.DropDown;
  
case RenderChoicesAs.ListBox:
  
return this.ListBox;
  
case RenderChoicesAs.HorizontalRadioButtons:
  
case RenderChoicesAs.RadioButtons:
  
return this.RadioButtons;

Let me know whether the proposed solution helps.

All the best,
Victor Velev
the Telerik team

Posted by Community Admin on 02-Mar-2011 00:00

Hi Victor,

I'm following the "How to create a basic module" tutorial (www.sitefinity.com/.../how-to-create-a-basic-module.aspx).

I added the DropDownList and RadioButtonList to the Upload Form Widget.

Thank you.

Posted by Community Admin on 03-Mar-2011 00:00

Hi Oguz,

Please include the code of your custom module so I could replicate the issue you have.

All the best,
Victor Velev
the Telerik team

Posted by Community Admin on 03-Mar-2011 00:00

Hi Victor,

I added the code. I have only modified the  "JobApplicationUpload.ascx" file and added some code and marked that block with "<!-- DROPDOWN LIST TEST START -->" between line 14-30

Thank you.



01.<%@ Control Language="C#" %>
02.<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
03.<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sitefinity" %>
04.<telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"></telerik:RadFormDecorator>
05. 
06.<sitefinity:Message
07.            runat="server"
08.            ID="message"
09.            ElementTag="div" 
10.            RemoveAfter="30000" 
11.            FadeDuration="10" />
12. 
13. 
14.    <!-- DROPDOWN LIST TEST START -->
15. 
16.        <asp:Label ID="lblDropDownTst" Text="Test Dropdown" runat="server" AssociatedControlID="ddlTest" Font-Bold="True"/><br />
17. 
18.               <asp:DropDownList id="ddlTest"
19.                    AutoPostBack="True"                   
20.                    runat="server">
21. 
22.                  <asp:ListItem Selected="True" Value="1"> 1 </asp:ListItem>
23.                  <asp:ListItem Value="2"> 2 </asp:ListItem>
24. 
25.               </asp:DropDownList>
26. 
27.<br /><br />
28. 
29. 
30.    <!-- DROPDOWN LIST TEST END -->
31. 
32. 
33.<asp:Label ID="Label1" Text="First Name" runat="server" AssociatedControlID="FirstName" Font-Bold="True"/><br />
34. 
35.<asp:TextBox ID="FirstName" runat="server" Width="100%" ValidationGroup="CVUpload"/>
36.<asp:RequiredFieldValidator ID="FirstNameRequired" runat="server" CssClass="sfError" Display="Dynamic" ValidationGroup="CVUpload"
37.                            ControlToValidate="FirstName" ErrorMessage="First name required" SetFocusOnError="true">
38.                            <strong>First name required</strong>
39.                        </asp:RequiredFieldValidator>
40.<br /><br />
41. 
42.<asp:Label ID="Label2" Text="Last Name" runat="server" AssociatedControlID="LastName" Font-Bold="True"/><br />
43. 
44.<asp:TextBox ID="LastName" runat="server" Width="100%" ValidationGroup="CVUpload" />
45.<asp:RequiredFieldValidator ID="LastNameRequired" runat="server" CssClass="sfError" Display="Dynamic" ValidationGroup="CVUpload"
46.                            ControlToValidate="LastName" ErrorMessage="Last name required" SetFocusOnError="true">
47.                            <strong>Last name required</strong>
48.                        </asp:RequiredFieldValidator>
49.<br /><br />
50.<asp:Label ID="Label4" Text="Phone Number" runat="server" AssociatedControlID="LastName" Font-Bold="True"/><br />
51. 
52.<asp:TextBox ID="Phone" runat="server" Width="100%" ValidationGroup="CVUpload"/>
53.<asp:RequiredFieldValidator ID="PhoneRequired" runat="server" CssClass="sfError" Display="Dynamic" ValidationGroup="CVUpload"
54.                            ControlToValidate="Phone" ErrorMessage="Phone Number required" SetFocusOnError="true">
55.                            <strong>Last name required</strong>
56.                        </asp:RequiredFieldValidator>
57.<br /><br />
58.<asp:Label ID="Label5" Text="How Did You Hear About Us?" runat="server" AssociatedControlID="HowDidYouHear" Font-Bold="True"/><br />
59. 
60.<telerik:RadComboBox ID="HowDidYouHear" runat="server">
61.<Items>
62.    <telerik:RadComboBoxItem runat="server" Text="Internet Ad"/>
63.    <telerik:RadComboBoxItem runat="server" Text="Mobile Phone Ad"/>
64.    <telerik:RadComboBoxItem runat="server" Text="Social Network"/>
65.    <telerik:RadComboBoxItem runat="server" Text="Television Ad"/>
66.    <telerik:RadComboBoxItem runat="server" Text="Web Link"/>
67.    <telerik:RadComboBoxItem runat="server" Text="Web Search"/>
68.    <telerik:RadComboBoxItem runat="server" Text="Magazine Ad"/>
69.    <telerik:RadComboBoxItem runat="server" Text="Other"/>
70.</Items>
71.</telerik:RadComboBox>
72.<br /><br />
73. 
74.<asp:Label ID="Label3" Text="Document Upload" runat="server" AssociatedControlID="RadUpload1" Font-Bold="True"/><br />
75. 
76.<telerik:RadUpload ID="RadUpload1" runat="server" AllowedFileExtensions=".doc,.docx,.pdf,.txt,.rtf,.odt" MaxFileInputsCount="1" Width="100%" InputSize="45" ControlObjectsVisibility="None"/>
77.<br />
78. 
79.<asp:Button runat="server" ID="SubmitButton" Text="Submit" Width="60px" ValidationGroup="CVUpload" CausesValidation="True" />

Posted by Community Admin on 03-Mar-2011 00:00

Hello Oguz,

Thank you for getting back to me.

After detailed test it seems there is a bug when rendering the dropdownlist. Please use RadComboBox until the issue is fixed up. I have logged it in our system and it will checked for our next sprint (#109584).

All the best,
Victor Velev
the Telerik team

Posted by Community Admin on 03-Mar-2011 00:00

Please note that, RadioButtonList is not rendered, too. I did not test CheckBoxList.

Thank you.

Posted by Community Admin on 21-Mar-2011 00:00

Hi Oguz, Victor,

I had the same problem with a CheckBoxList. The problem seems to be related to ListItems because the List is existing in code behind just without the ListItems. 
I got it running by setting ListItems in code behind during override of SimpleViews InitializeControls(GenericContainer container).

Regards
Udo

Posted by Community Admin on 24-Mar-2011 00:00

Hi Udo ,

Thank you for sharing this workaround about the issue. You can use it until the problem is fixed in our future releases.

Best wishes,
Victor Velev
the Telerik team

Posted by Community Admin on 15-Nov-2011 00:00

Hi 

I just came across this old thread while searching for a solution - I have the same problem with a custom control assembly I'm creating for SF4.3 (inheriting SimpleView). Was this ever resolved? Neither DropDownList or CheckBoxList are rendering the items.

Posted by Community Admin on 16-Nov-2011 00:00

Hello Nick,

The issue was not reproduced in later versions of Sitefinity. We have done some tests using different codes, including the one provided by Oguz.

Can you send us the control so we can have a look at it.

Kind regards,
Victor Velev
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 20-Jan-2012 00:00

Hi,

We still have this problem (4.4.2117.0).

The control couldn't be any simpler:

<%@ Control Language="C#" AutoEventWireup="true" %>
<asp:CheckBoxList ID="ContactPreferences" runat="server" RepeatLayout="UnorderedList">
<asp:ListItem Value="Email">Email</asp:ListItem>
<asp:ListItem Value="SMS">SMS</asp:ListItem>
<asp:ListItem Value="Phone">Phone</asp:ListItem>
</asp:CheckBoxList>

This is just a single control in a custom module, and this renders absolutely no HTML. The only way to get it working is to add the listitems programmatically. When doing that the HTML renders fine. It works but it's not ideal.

This has happened in several different projects in several different versions. 

Posted by Community Admin on 25-Jan-2012 00:00

Hi Nick,

Can you clarify what do you mean by " the provided code does not render html "?

Greetings,
Victor Velev
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

This thread is closed