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

[Solved] selectedindexchnged problem

2 Answers 139 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
abhay
Top achievements
Rank 1
abhay asked on 27 Apr 2009, 08:40 AM
When i select one items from combobox 

SelectedIndexChanged  event fired and i click one button to reset the combobox ,then select the previously selected item then SelectedIndexChanged  event doesn't fired .
plz help me in this issue.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Apr 2009, 09:48 AM
Hi Abhay,

I tried the scenario and found it is working fine in my end. I tried this with the latest version of RadControls ASP.NET AJAX and also the previous version (2008.03.1314.35). See the code which I tried.

ASPX:
    
<telerik:RadComboBox ID="RadComboBox2" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox2_SelectedIndexChanged">     
    <Items>    
        <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" />    
        <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" />    
        <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" Value="RadComboBoxItem3" />    
    </Items>    
</telerik:RadComboBox>    
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Reset Combo" /> 

CS:
 
protected void RadComboBox2_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
{  
    // Fires when the user selects a new item in the drop-down list  
}  
protected void Button1_Click(object sender, EventArgs e)  
{  
    RadComboBox2.ClearSelection();  
Feel free to post the code that you tried if this is different from scenario which I tried.

Thanks,
Princy.
0
abhay
Top achievements
Rank 1
answered on 27 Apr 2009, 10:19 AM
You have reset it at serverside,but i am doing that at clientside.if i do like the codes given by you then it,'s ok.But at clientside after reset it and select an item ,then 

SelectedIndexChanged doesn't fired.

RESET CODE


 

$find(

"<%= RadComboBoxDiagnosis.ClientID %>").clearSelection();

 

$find(

"<%= RadComboBoxDiagnosis.ClientID %>").set_text($find("<%= RadComboBoxDiagnosis.ClientID %>").get_emptyMessage());

 

$find(

"<%= RadComboBoxDiagnosis.ClientID %>").set_value("");

 

 


plz help me in this issue.

Tags
ComboBox
Asked by
abhay
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
abhay
Top achievements
Rank 1
Share this question
or