ClearCheckedItems is not working in server side

4 posts, 0 answers
  1. iomega 55
    iomega 55 avatar
    64 posts
    Member since:
    Dec 2004

    Posted 26 Aug 2012 Link to this post

    I need to reset a radcombox in the server side, I am using the ClearCheckedItems method but it is not working, after the callback the checkboxes continue checked.

    Is there any way for resetting a radcombox in the server side?

    Thanks in advance
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 27 Aug 2012 Link to this post

    Hi iomega 55,

    Can you explain the scenario that you implement in more details and paste here the RadComboBox definition that you use?

    Regards,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. iomega 55
    iomega 55 avatar
    64 posts
    Member since:
    Dec 2004

    Posted 27 Aug 2012 Link to this post

    I have various comboxes in my .aspx, so I apply a custom filter. All the comboxes are defined like this:
    <telerik:RadComboBox ID="cmbAType" runat="server" 
        DataValueField="rowno" DataTextField="descr" EmptyMessage=" -- All -- " HighlightTemplatedItems="true"
         AllowCustomText="true" Width="105px"  OnClientDropDownClosed="onDropDownClosingT">
        <ItemTemplate>
            <div onclick="StopPropagation(event)">
                <asp:CheckBox runat="server" ID="chk1" onclick="onCheckBoxClickT(this)" />
                <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">
                    <%# Eval("descr")%>
                </asp:Label>
            </div>
        </ItemTemplate>
    </telerik:RadComboBox>

    When I click on the filter button, codebehind a filter(based in the comboxes selected value) is applied to the grid. I can select any options in the comboxes and everything goes ok.

    But I need to clear the filter, so I put another button for this purpose, and codebehind I need to reset the comboxes text, selecteded items, etc to its initial state.

    protected void btnCFilter_Click(Object sender, EventArgs e)
         {
             txtC.Text = "";
             cmbAType.ClearCheckedItems();
             cmbAStatus.ClearCheckedItems();
             cmbZone.ClearCheckedItems();
             cmbUnit.ClearCheckedItems();
             txtEndDate.SelectedDate = null;
             txtStartDate.SelectedDate = null;
             grdCCC.Rebind();
         }

    But after the callback, the comboxes remain with the values before the callback, same text, same selected items.




  4. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 29 Aug 2012 Link to this post

    Hello iomega 55,

    The ClearCheckedItems works when you use the RadComboBox CheckBoxes feature.
    As I can see from your code - you implement custom checkboxes in the control ItemTemplate.
    That is why you are not able to use the ClearCheckedItems method to clear these checkboxes.

    Regards,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top