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

combobox with checkboxes is giving a postback on close

3 Answers 195 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Paul Evers
Top achievements
Rank 2
Paul Evers asked on 11 May 2015, 03:02 PM

Hi,

I have a RadComboBox with the checkboxes active. I want to have a postback for the ItemChecked event.

The combobox also is generating a postback on closing of the dropdown which I do not want. How can I prevent this to happen.

I have found a similar thread (http://www.telerik.com/forums/radcombobox-auto-post-back-issue) but the link to the solution presented there does not work anymore.

 

Paul

3 Answers, 1 is accepted

Sort by
0
Aneliya Petkova
Telerik team
answered on 13 May 2015, 08:43 AM
Hello Paul,

Thank you for contacting us.

The ItemChecked event does not fire unless the AutoPostBack property is True as well as CheckBoxes property. Please try the following example:
.aspx:
<form id="form1" runat="server">
    <asp:ScriptManager runat="server" />
    <div>
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1">
            <telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Silk" CheckBoxes="true" RenderMode="Classic"
                AutoPostBack="true" EmptyMessage="Select" OnItemChecked="RadComboBox1_ItemChecked">
                <Items>
                    <telerik:RadComboBoxItem Text="Arts" />
 
                    <telerik:RadComboBoxItem Text="Biographies" />
 
                    <telerik:RadComboBoxItem Text="Children's Books" />
 
                    <telerik:RadComboBoxItem Text="Computers & Internet" />
 
                    <telerik:RadComboBoxItem Text="Cooking" />
 
                    <telerik:RadComboBoxItem Text="History" />
 
                    <telerik:RadComboBoxItem Text="Fiction" />
 
                    <telerik:RadComboBoxItem Text="Mystery" />
 
                    <telerik:RadComboBoxItem Text="Nonfiction" />
 
                    <telerik:RadComboBoxItem Text="Romance" />
 
                    <telerik:RadComboBoxItem Text="Science Fiction" />
 
                    <telerik:RadComboBoxItem Text="Travel" />
                </Items>
 
            </telerik:RadComboBox>
            <asp:Button Text="Do Postback" runat="server" />
            <br />
            <asp:Label ID="Label1" Text="" runat="server" />
        </telerik:RadAjaxPanel>
    </div>
</form>

aspx.cs:

protected void RadComboBox1_ItemChecked(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
{
    Label1.Text += e.Item.Text + "</br>";
}

More information about ItemChecked event, you may find in the following help article:
http://www.telerik.com/help/aspnet-ajax/combobox-server-side-item-checked.html

Hope this will be helpful. If you have further questions, please feel free to contact us again.

Regards,
Aneliya Petkova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Paul Evers
Top achievements
Rank 2
answered on 13 May 2015, 09:15 AM

Hi Aneliya,

The autopostback for the ItemChecked is not the issue. That is working fine. The issue is that besides a postback for the ItemChecked I get also a postback for closing (or leaving) the dropdown. This is undesirable. My question is how to prevent the last postback to happen without disturbing the postback for the ItemChecked.

Regards,

Paul

 

 

0
Aneliya Petkova
Telerik team
answered on 13 May 2015, 10:12 AM
Hi Paul,

Did you try the example I showed you in my previous post? I made a video for you showing that no postback on closing or opening the dropdown is performed - only for checking the items in the RadComboBox. I tested using 2015 Q1 SP1 release.

In order to help you, I will need to test and inspect your exact implementation of the RadComboBox. Also could you please confirm which version of Telerik UI for ASP.NET AJAX you are using?

Regards,
Aneliya Petkova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Paul Evers
Top achievements
Rank 2
Answers by
Aneliya Petkova
Telerik team
Paul Evers
Top achievements
Rank 2
Share this question
or