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

Strange Activity On ComboBox Index Change

1 Answer 40 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 01 Dec 2009, 06:37 PM
I have a RadWindow that pops up with a couple of different FormViews on it.  Each of these can be edited independently, etc.

I also have a RadComboBox on the top of my page, then should display the surrent "state" of the record. When it is changed I update the state as follows:

Protected Sub list_appState_SelectedIndexChanged(ByVal o As ObjectByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) 
 
 
            Dim record As Integer = (TryCast(Parent.FindControl("GridRec"), Label)).Text 
            Dim AppState As String = (TryCast(formview_AppInfo.FindControl("list_appState"), RadComboBox)).SelectedValue 
 
            Dim UpdateSuccess As Integer = Applications.UpdateAppState(record, AppState) 
 
            If UpdateSuccess > 0 Then 
                lbl_status.Text = String.Format("<br />The Application Status has been updated to '{0}' for record: {1}.<br /><br />", AppState, record) 
                Dim grid As RadGrid = (TryCast(Parent.FindControl("grid_applications"), RadGrid)) 
            End If 
 
    End Sub 

This works correctly.  HOWEVER, every single time I click edit on any of my other formviews on the page, the combobox index gets changed and this gets called so it updates it automatically just by putting on of my formviews in edit mode.

Here is the combobox control on the page.

<telerik:RadComboBox ID="list_appState" Runat="server" Skin="Sunset" SelectedValue='<%# Bind("app_state") %>' AutoPostBack="True" OnSelectedIndexChanged="list_appState_SelectedIndexChanged"
                <Items> 
                    <telerik:RadComboBoxItem runat="server" Text="New/Working Lead" Value="New" ForeColor="Blue" /> 
                    <telerik:RadComboBoxItem runat="server" Font-Bold="True" 
                        Text="Dead Lead" Value="Dead" ForeColor="Red" /> 
                    <telerik:RadComboBoxItem runat="server" Font-Bold="True" 
                        Text="Sold To Customer" Value="Sold" ForeColor="Green" /> 
                        <telerik:RadComboBoxItem runat="server" Text="Customer Appointment"  
                        Value="Appointment" Enabled="False" ForeColor="#BA3D05" Font-Bold="True" /> 
                        <telerik:RadComboBoxItem runat="server" Text="Call Back" Value="Call Back" Enabled="False" ForeColor="#BA3D05" Font-Bold="True" /> 
                        <telerik:RadComboBoxItem runat="server" Text="Email Customer" Value="Email Customer" Enabled="False" ForeColor="#BA3D05" Font-Bold="True" /> 
                        <telerik:RadComboBoxItem runat="server" Text="Follow Up" Value="Follow Up" Enabled="False" ForeColor="#BA3D05" Font-Bold="True" /> 
                        <telerik:RadComboBoxItem runat="server" Font-Bold="True" 
                        Text="Credit Accepted" Value="Credit Accepted" Enabled="False" ForeColor="Green" /> 
                        <telerik:RadComboBoxItem runat="server" Font-Bold="True" 
                        Text="Credit Declined" Value="Credit Declined" Enabled="False" ForeColor="Red" /> 
                        <telerik:RadComboBoxItem runat="server" Font-Bold="True" 
                        Text="Credit Pending" Value="Credit Pending" Enabled="False" ForeColor="#BA3D05" /> 
                </Items> 
                <CollapseAnimation Duration="200" Type="OutQuint" /> 
            </telerik:RadComboBox> 

It is binded to the right control, but why when any of the other forms go into edit mode does it switch to 'New' and then run the index changed event?  This shouldn't be executing at all unless the dropdown is physically changed right?



1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 02 Dec 2009, 09:56 AM
Hi Shawn,

Yes, this should not be happening, except in one specific case.

Are you using AJAX and not updating the ComboBox on its SelectedIndexChanged event?

Greetings,
Simon
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
Shawn
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or