SelectedIndexChanged Postback without refreshing

2 posts, 0 answers
  1. Newbiew
    Newbiew avatar
    1 posts
    Member since:
    Dec 2013

    Posted 10 Dec 2013 Link to this post

    I'm going to try and make this as short as possible another developer created some controls, I am attempting to use a checkboxlist that when an item is selected to have the data entered in a Listbox.  With using a postback the page refreshes every time I select an item, so I started searching on how to postback without refreshing the page. The closest that I have gotten is with the attached code; the issue with the current code is the information is entered into the box but it is as though some event is waiting to happen after I select an item because I am getting the spinning symbol when I move around various spots on the page and it prevents me from clicking on a seperate button while this is occurring.  If anyone can provide any assistance please help.  I have attempted to use the below forums as reference.
    in ascx
    <telerik:RadComboBox ID="rcb_County" runat="server" OnDataBound="rcb_County_DataBound">
                                        <asp:CheckBoxList ID="cbl_County" runat="server" autopostback="True" OnSelectedIndexChanged="CheckBoxList_SelectedIndexChanged">
                                <asp:CustomValidator ID="cvCounty" runat="server" ClientValidationFunction="validateCounty"
                                    CssClass="validation" ErrorMessage="* Required"></asp:CustomValidator>
    in ascx
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="rcb_County">
                    <telerik:AjaxUpdatedControl ControlID="rcb_County" />
    Code Behind
    protected void CheckBoxList_SelectedIndexChanged(object sender, EventArgs e)
                CheckBoxList cbl_County = rcb_County.Items[0].FindControl("cbl_County") as CheckBoxList;
                foreach (ListItem val in cbl_County.Items)
                    if (val.Selected)
  2. Nencho
    Nencho avatar
    1446 posts

    Posted 13 Dec 2013 Link to this post


    First of all, I would like to ask you to elaborate on the implementation of the RadComboBox. The RadComboBox has its own build-in feature for CheckBoxes, by simply enabling its CheckBoxes property. Did you purposely implemented the approach using a CheckBoxList in its ItemTemplate? However, if the CheckBoxes feature of the RadComboBox is enabled, you could easily achieve the desired functionality, by handling the OnTextChanged event of the control. The event would be fired, once the client selects the desired checkboxes from the RadComboBox and the control is blurred. At the OnTextChanged event handler, you could access the checked items and populate the other control. I am sending you a sample page, demonstrating the implementation of the above suggestion.

    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top