More in this section

Forums / Developing with Sitefinity / Issue with CheckBox in admin panel of custom control

Issue with CheckBox in admin panel of custom control

4 posts, 1 answered
  1. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    08 Jul 2009
    Link to this post
    Hey all, I am having a problem with the way checkboxes are being displayed inside the administration panel of my custom module:


    Here is the section of the UserControl code that the problem is in:

    <li> 
        <asp:Label ID="lblState" runat="server" Text="State *" AssociatedControlID="stateDropDown" /> 
        <telerik:RadComboBox ID="stateDropDown" runat="server" DataSourceID="StateDropDownDataSource" DataTextField="name" 
            DataValueField="id" AppendDataBoundItems="true"
            <Items> 
                <telerik:RadComboBoxItem Value="00000000-0000-0000-0000-000000000000" Text="Genius" /> 
                <telerik:RadComboBoxItem IsSeparator ="true" Text="States:" /> 
            </Items> 
            <%--<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>--%> 
        </telerik:RadComboBox> 
        <asp:LinqDataSource ID="StateDropDownDataSource" runat="server" ContextTypeName="GSFyi.GSFyiDataClasses_DataContext" 
            TableName="FYI_States" Where="id != @id" OrderBy="name" > 
            <WhereParameters> 
                <asp:Parameter DbType="Guid"  
                    DefaultValue="00000000-0000-0000-0000-000000000000" Name="id" /> 
            </WhereParameters> 
        </asp:LinqDataSource> 
    </li> 
    <li id="chkUpdateContainer" runat="server" visible="false"
        <asp:checkbox ID="chkUpdateState" runat="server" Text="Update State?" /> 
    </li> 

    Looking at the generated source of the page, I cannot see anything wrong:

    <li id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_ctl00_chkUpdateContainer">  
        <input id="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_ctl00_chkUpdateState" type="checkbox" name="ctl00$ContentPlaceHolder1$contolPanel$ctl00$ctl01$ctl00$chkUpdateState" /><label for="ctl00_ContentPlaceHolder1_contolPanel_ctl00_ctl01_ctl00_chkUpdateState">Update State?</label>  
    </li>  


    Any ideas what could be causing this?

    Thanks!
    anders
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 Jul 2009
    Link to this post
    Hello andersleet,

    Please try the following way for displaying the RadComboBox and CheckBox control. (Add the LinqDataSource control back to your declaration - it was removed for testing purposes.)

     <h3><asp:Literal ID="Literal21" runat="server" Text="TEST"></asp:Literal></h3
                    <fieldset class="set"
                    <ol class="setIn clearfix"
                        <li class="catSel clearfix"
                            <li> 
                                <asp:Label ID="lblState" runat="server" Text="State *" AssociatedControlID="stateDropDown" />  
                                <telerik:RadComboBox ID="stateDropDown" runat="server" DataTextField="name"  
                                    DataValueField="id" AppendDataBoundItems="true">  
                                    <Items>  
                                        <telerik:RadComboBoxItem Value="00000000-0000-0000-0000-000000000000" Text="Genius" />  
                                        <telerik:RadComboBoxItem IsSeparator ="true" Text="States:" />  
                                    </Items>  
                                </telerik:RadComboBox>  
                            </li>  
                <li id="chkUpdateContainer" runat="server" visible="true" class="check" style="padding-left: 130px; "
                <asp:checkbox ID="chkUpdateState" runat="server" />  
                 <asp:Label AssociatedControlID="chkUpdateState" ID="Literal19" runat="server" Text="UpdateState"></asp:Label> 
                         
                 </li> 
                     </li>                                                  
                        </ol> 
                    </fieldset> 
                     
                    <div class="bottom"><div><!-- --></div></div> 
     

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  3. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    10 Jul 2009
    Link to this post
    Thanks Ivan, I did exactly that at first until this post. The reason I had this checkbox in the first place was because I could not figure out how to set the selected index of the combobox, so I figured if I added a checkbox it would update the state if it was checked.

    Cheers!
    anders
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 Jul 2009
    Link to this post
    Hi andersleet,

    Thanks for getting back.

    I hope that now everything is working fine. If you get stuck, write back to us.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 1 answered