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

[Solved] Retaining Text in Multi Selection Combo

2 Answers 126 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Eric Turner
Top achievements
Rank 1
Eric Turner asked on 09 Oct 2009, 03:01 PM
I have a RadComboBox with an Item Template to do multi selection.  When the user clicks in the check boxes in the drop down the appropriate text is placed in the Combobox Text just as in the Telerik examples.  But When the user closes the combo I want the server event OnSelectedIndexChanged to fire so I can reload other combos based on the selections from the previous combo. 

The only way I could get OnSelectedIndexChanged  to fire is by setting AutoPostPack to "True".  But when I did that it would wipe out the text of the changed combobox.  So I set EnableViewState to "False" and that wiped out the entire combobox.

How can I retain the text values in the combobox after a postback?  Or am I going about this the wrong way?




<telerik:RadComboBox ID="cbOrganization" Runat="server"  
                        AppendDataBoundItems="True" HighlightTemplatedItems="True"                          
                        OnItemsRequested="cbOrganization_ItemsRequested" 
                        OnSelectedIndexChanged="cbOrganization_SelectedIndexChanged"                         
                        AutoPostBack="True"
                        <ItemTemplate> 
                            <asp:CheckBox ID="chk" runat="server" onclick="StopPropagation(event)"  
                                Text='<%# DataBinder.Eval(Container.DataItem, "fffb_organizations") %>'  
                                oncheckedchanged="chk_CheckedChanged" /> 
                        </ItemTemplate> 
                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                    </telerik:RadComboBox> 



2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 13 Oct 2009, 10:42 AM
Hello Eric,

Please set EnableLoadOnDemand property of the combobox to true and let us know how it goes.

Greetings,
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.
0
Eric Turner
Top achievements
Rank 1
answered on 13 Oct 2009, 05:14 PM
After a quick glance that seems to have fixed the problem.

Thanks
Tags
ComboBox
Asked by
Eric Turner
Top achievements
Rank 1
Answers by
Yana
Telerik team
Eric Turner
Top achievements
Rank 1
Share this question
or