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

radcombo with checkboxes

1 Answer 74 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Vikas
Top achievements
Rank 1
Vikas asked on 10 Dec 2010, 05:59 AM
I am having following markup for radCombo

<telerik:RadComboBox ID="rcbNewCategory" runat="server" Width="250px" Height="100px" Skin="Office2007"
                   AllowCustomText="true" ShowToggleImage="true" ShowMoreResultsBox="True" DataTextField="CategoryName" DataValueField="ID"
                    EnableLoadOnDemand="true"
                      EnableVirtualScrolling="true" HighlightTemplatedItems="true"  
                     Visible='<%# FillCategory(DataBinder.Eval( Container, "DataItem.ID")) %>' >
                    <ItemTemplate>
                        <div>
                        <asp:UpdatePanel ID="pnl2" runat="server">
                        <ContentTemplate>
                        <div onclick="stopPropagation(event)" >
                            <asp:CheckBox runat="server" ID="chkCat" Checked="false" OnCheckedChanged="chkCat_Changed"
                            ToolTip='<%# DataBinder.Eval(Container,"DataItem.CategoryName") %>' AutoPostBack="true"/>
                            <asp:Label runat="server" ID="Label2" Text='<%# DataBinder.Eval(Container,"DataItem.CategoryName") %>'>                                   
                            </asp:Label>
                            </div>
                            </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </ItemTemplate>
                </telerik:RadComboBox>

It works fine. Even if i click inside checkbox, I can update the combobox Text with ";" seprated values.

But if i have to use ItemRequested event to show only 10 items at a time,
//OnItemsRequested="rcbNewCategory_ItemsRequested"
It fails on checkbox selection change event.
Reason:   ItemCount for combobox is always 0 at the server side.

Please can you tell me the quick solution. Do i am missing some property.
I was thinking to bind the control again at the page load. But how i will know the items that were bound before. Do i have to maintain status for it in viewstate or hidden field?

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 16 Dec 2010, 11:37 AM
Hi Vikas,

Sorry for contacting you so late.

Unfortunately you couldn't use load on demand and server-side event of the CheckBox at the same time.
When a postback occur  the information from the combo is lost and nothing is preserved on the server.
One possible solution is to implement the logic of the server-side event of the CheckBox into a client side event or not to use load on demand of the ComboBox.
 
Best wishes,
Dimitar Terziev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ComboBox
Asked by
Vikas
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or