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

[Solved] Radcombobox itemtemplate and ajax

1 Answer 106 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Travis
Top achievements
Rank 1
Travis asked on 14 Oct 2009, 05:10 PM
Hi I am trying to hook up an ajax event every time a checkbox is clicked inside of a dynamically populated radcombobox itemtemplate that contains a label and checkbox.  I get the ajax to work on the first checkbox that is clicked and it refreshes the grid using ajax but once you click a second item it causes a postback. What is the best way to accomplish this?

    Protected Sub chk1_CheckedChanged(ByVal sender As ObjectByVal e As EventArgs) 
        rgReceived.Rebind() 
    End Sub 
 
    Protected Sub rcbBehavior_ItemCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles rcbBehavior.ItemDataBound 
        Dim chkBox As CheckBox = e.Item.FindControl("chk1"
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(chkBox, rgReceived, RadAjaxLoadingPanel1) 
    End Sub 

 
        <telerik:RadComboBox ID="rcbBehavior"  
    runat="server" AllowCustomText="true" ZIndex="3" 
                                 
    OnClientDropDownOpening="OnClientDropDownOpenedHandler" EmptyMessage="Select Behaviors..." 
                                HighlightTemplatedItems="true" Width="240px"
            <ItemTemplate> 
                <div> 
                    <asp:CheckBox ID="chk1" runat="server" Checked="true" AutoPostBack="true" onclick="onCheckBoxClick(this);" 
                                            OnCheckedChanged="chk1_CheckedChanged" /> 
                    <asp:Label ID="Label1" runat="server" AssociatedControlID="chk1"
                                <%#Eval("Title")%> 
                                        </asp:Label> 
                </div> 
            </ItemTemplate> 
        </telerik:RadComboBox> 


1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 20 Oct 2009, 08:37 AM
Hi Travis,

I suggest you allow the whole combobox to update the grid, not every checkbox in its template.

Best regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Travis
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or