This is a migrated thread and some comments may be shown as answers.

ClearCheckedItems is not working in server side

3 Answers 49 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 26 Aug 2012, 10:19 AM
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

3 Answers, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 27 Aug 2012, 09:55 AM
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.
0
iomega 55
Top achievements
Rank 1
answered on 27 Aug 2012, 10:27 PM
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.




0
Kalina
Telerik team
answered on 29 Aug 2012, 10:27 AM
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.
Tags
ComboBox
Asked by
iomega 55
Top achievements
Rank 1
Answers by
Kalina
Telerik team
iomega 55
Top achievements
Rank 1
Share this question
or