I've got two comboboxes with two objectdatasources:
The first combobox I have no problems with. I can selected any entry, and on postback it retains its values.
The second combobox however, when selecting a new item, it loses its value every time. Page_Init its SelectedIndex is -1. Page_Load, always 0!! Even when declaring OnSelectedIndexChanged, still 0. ALWAYS 0 or -1!
Any ideas? Thanks in advance.
PS. Also found something really quirky. I can select an entry, then if I deselect (lose the focus of the second combobox) it reverts to the SelectedIndex = 0.
<telerik:RadComboBox ID="RadComboBoxConnection" runat="server" Height="200px" Width="300px" |
Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false" AllowCustomText="false" |
DataSourceID="ObjectDataSourceConnection" DataTextField="DatabaseFriendlyName" DataValueField="ImportConnectionId" AutoPostBack="true" EnableViewState="true"> |
</telerik:RadComboBox> |
<telerik:RadComboBox ID="RadComboBoxObject" runat="server" Height="200px" Width="300px" |
Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false" AllowCustomText="false" |
DataSourceID="ObjectDataSourceObject" DataTextField="ObjectName" DataValueField="ImportObjectId" AutoPostBack="true" EnableViewState="true" OnSelectedIndexChanged="RadComboBoxObject_OnSelectedIndexChanged"> |
</telerik:RadComboBox> |
<asp:Literal ID="litMessage" runat="server" /> |
<asp:ObjectDataSource ID="ObjectDataSourceConnection" runat="server" |
TypeName="Ams.Web.BackOffice.ImportConnectionAdapter" |
DataObjectTypeName="Ams.Core.DomainObject.ImportConnection" |
OldValuesParameterFormatString="original_{0}" |
ConflictDetection="CompareAllValues" |
SelectMethod="SelectImportConnection" /> |
<asp:ObjectDataSource ID="ObjectDataSourceObject" runat="server" |
TypeName="Ams.Web.BackOffice.ImportObjectAdapter" |
DataObjectTypeName="Ams.Core.DomainObject.ImportObject" |
OldValuesParameterFormatString="original_{0}" |
ConflictDetection="CompareAllValues" |
SelectMethod="SelectImportObject"> |
<SELECTPARAMETERS> |
<asp:ControlParameter Name="aImportConnectionId" PropertyName="SelectedValue" ControlID="RadComboBoxConnection" /> |
</SELECTPARAMETERS> |
</asp:ObjectDataSource> |
The first combobox I have no problems with. I can selected any entry, and on postback it retains its values.
The second combobox however, when selecting a new item, it loses its value every time. Page_Init its SelectedIndex is -1. Page_Load, always 0!! Even when declaring OnSelectedIndexChanged, still 0. ALWAYS 0 or -1!
Any ideas? Thanks in advance.
PS. Also found something really quirky. I can select an entry, then if I deselect (lose the focus of the second combobox) it reverts to the SelectedIndex = 0.