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

Selected item won't change when from server side code

1 Answer 68 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Hector
Top achievements
Rank 1
Hector asked on 14 Jul 2010, 02:56 PM
I have a RadComboBox that inside a RadRotatorItem that when I change the selected item through server side code, it does not reflect on the page.  On page load, I try changing the selected item using RadComboItem.SelectedIndex = 3 or RadComboItem.Items[3].Selected = true; but neither work.  Here is my code:

ASPX:
<telerik:RadComboBox ID="cmbReminder_1" MarkFirstMatch="True" runat="server" Height="190px"
                                                    Width="100px" Skin="Default" AutoPostBack="False" HighlightTemplatedItems="True"
                                                    ShowToggleImage="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged1">
                                                    <ItemTemplate>
                                                        <table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;"
                                                            width="60px">
                                                            <tr>
                                                                <td>
                                                                    <img src='/Images/<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt="" />
                                                                </td>
                                                                <td>
                                                                    <%# DataBinder.Eval(Container, "Attributes['DisplayName']") %>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </ItemTemplate>
                                                    <Items>
                                                        <telerik:RadComboBoxItem ImagePath="EmailIcon_32x32p.png" DisplayName="Email" Text="Email" Value="1">
                                                        </telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem ImagePath="TextIcon_32x32p.png" DisplayName="SMS" Text="SMS" Value="2">
                                                        </telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem ImagePath="PhoneIcon_32x32p.png" DisplayName="Phone" Value="3"
                                                            Text="Phone"></telerik:RadComboBoxItem>
                                                         
                                                    </Items>
                                                </telerik:RadComboBox>

Code behind:
RadRotatorItem step3Item = (RadRotatorItem)this.RadRotatorHorizontal.Controls[2];
RadComboBox cmbTiming_2 = (RadComboBox)step3Item.FindControl("cmbTiming_2");

I am getting the correct control because when I step through the code, I examine the cmbTiming_2 and it contains the correct items.
Any help is appreciated

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 16 Jul 2010, 05:10 PM
Hello Hector,

We tried to reproduce the problem you described, but without much success. Please find attached a project as part of our local tests.
Could you modify it with the exact your configuration to examine it locally?

Regards,
Helen
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Hector
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or