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

RadComboBox SelectedIndexChanged fired incorrectly

12 Answers 573 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sanjeev
Top achievements
Rank 1
Sanjeev asked on 10 May 2010, 02:49 PM
hi,

i am using RadComboBox 2010 Q1 and  i got a problem that on my button click a event OnSelectedIndexChanged of RadComboBox is fired automatically. i want to fire only if i change the value in radcombobox itself only.
The issue is also raised to several links but still not able the configure the issue. Below is the enviroment for the generation

Step - 1  Add Control to page.
Step - 2 Set the Following combobox properties to source page 

 

 

              <telerik:RadComboBox ID="RadComboBox1" runat="server"   OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">

 

 

 

 

 

</telerik:RadComboBox>

Step - 3 Page OnLoad Code

 

 

                

 

 

if (Page.IsPostBack)

 

{

 

return;

 

}

 

RadComboBox1.ShowToggleImage =

false;

 

RadComboBox1.Skin =

"Office2007";

 

RadComboBox1.EnableLoadOnDemand =

false;

 

RadComboBox1.AutoPostBack =

true;

 

RadComboBox1.MarkFirstMatch =

true;

 

RadComboBox1.AllowCustomText =

true;

 

RadComboBox1.Height =

Unit.Pixel(100);

 

RadComboBox1.Items.Add(

new RadComboBoxItem("1"));

 

RadComboBox1.Items.Add(

new RadComboBoxItem("2"));

 

RadComboBox1.Items.Add(

new RadComboBoxItem("3"));

 

RadComboBox1.Items.Add(

new RadComboBoxItem("4"));

 

 

        

Step - 4  Define Selecetd Index Changed
        

 

 

protected void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

 

{

 

string s = "ppppp";

 

}

 

 

    now degug the page either page button click goes to Selected index changes event or first select the item and then hit the button onclick.

The Same issue is post to several links like 
    http://www.telerik.com/community/forums/aspnet-ajax/combobox/radcombobox-selectedindexchanged-fired-incorrectly.aspx

Thanks,
Sanjeev

            

12 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 13 May 2010, 02:46 PM
Hello Sanjeev,

This issue originates from the fact that all of your Items have empty values. You can avoid it by setting some unique values to the Items, e.g. Value = Text.

Sincerely yours,
Simon
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.
0
Fabio
Top achievements
Rank 1
answered on 25 Oct 2010, 05:16 PM
Hi!

I got the same problem, even if the values are corretly set.

But my case is different.

I got a page with the radcombobox (text and values set correctly). I change the item of combo and the event is fired as well.

ok

i open a modal window with RadWindowManager. When I close the window the selectedindexchange is newly fired with the same RadComboBoxSelectedIndexChangedEventArgs used before... and if I close my window I don't change the combo...

the eventargs are set with same args (oldvalue, oldtext, text ecc)...

Any help? Thank you
Fabio - Nettunosolutions.
0
Simon
Telerik team
answered on 02 Nov 2010, 02:56 PM
Hello Fabio,

This points to the following issue: the page is posted back and the RadComboBox client-state field is not updated from the previous postback when the selected index actually has changed.

Can you capture the request/response pairs with FiddlerCap or FireBug and send post them here to inspect them?

Kind regards,
Simon
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
0
Terry
Top achievements
Rank 1
answered on 10 Jan 2012, 10:55 PM
Was a resolution to this problem ever provided?  I am experiencing the same problem whereby clicking another button is causing the combobox_selectedindexchanged event to fire.

I am running 2011.2.915.40 of the the controls.
0
Simon
Telerik team
answered on 16 Jan 2012, 11:15 AM
Hi Terry,

We haven't received any additional info about this problem in this thread. Please test with the latest version of RadControls or send us a sample project illustrating the problem via a support ticket - we will look into it.

Greetings,
Simon
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Domingo
Top achievements
Rank 1
answered on 20 Jun 2012, 06:49 PM
I was getting a similar problem, in my case, I have "EnabledLoadOnDemand = True" and I also have "AutoPostBack = True" and the SelectedIndexChanged event was being fired even with the DropDown list open.

In my case, the postback was caused by other controls (a Timer or a RadAjaxManager) behind the scenes, so I had to screen for the the control that was causing the postback to then decide if I wanted to react to the event or not.

It's not elegant but is working for my case.... so, inside my Event Handler for SelectedIndexChanged:

 

 

 

 

If Request.Params("__EVENTTARGET") = MyRadComboBox.ClientID.Replace("_", "$") Then

 

 

 

    'My RadComboBox caused this postback

 

 

 

    'Request.Params("__EVENTTARGET"): "MyPage$Panel1$MyRadComboBox"

 

 

 

    'MyRadComboBox.ClientID: "MyPage_Panel1_MyRadComboBox"

 

 

 

    DoMyWork()

 

 

Else

 

 

 

    'A different control caused this postback, ignore it

 

 

 

End If

 

0
ash
Top achievements
Rank 1
answered on 13 Jul 2015, 10:37 AM

[quote]Not again - Q2 2015[/quote]

Problem:

 - Radcombobox with checkbox support enabled...

 - OnPostBack of any control on the form, a button or text or radio button or any postback - it fires OnSelectedIndexChanged event for all the radcombobox controls on the page.

Q2 2014 release it was fixed... But in Q2 2015 release its back to haunt, cannot upgrade to new release as it will break the old behaviour...

Telerik support replies asking to change our entire code - wants us to use implement 'OnItemChecked' & 'OnCheckAllCheck' instead of one 'OnSelectedIndexChanged' event...

Why should it fire events for controls not in '__Target' ? 

Hope to hear from support or someone soon... 

0
Ivan Danchev
Telerik team
answered on 16 Jul 2015, 07:35 AM
Hello,

To help us get a better idea of the scenario could you please try to reproduce the issue in the attached sample project and if any modifications are needed in order to reproduce it post them along with the steps that lead to the observed behavior?

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
ash
Top achievements
Rank 1
answered on 16 Jul 2015, 09:42 AM

Hello, thanks for your reply

 We are still working on VS2010 and hence cannot open the project supplied, says it is incompatible with the vs version

 Please reply back with vs2010 compatible source...

 regards, ash

0
Ivan Danchev
Telerik team
answered on 21 Jul 2015, 07:29 AM
Hello,

Please find attached a VS 2010 compatible web site.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
ash
Top achievements
Rank 1
answered on 21 Jul 2015, 08:58 AM

hello two things in your sample:

1) Site.master is missing - cannot execute your sample provided - try 2

2) Rad - combo box is not bound to any data source - which is how combo boxes are used in real applications...

Please try to compile and build your project before sending across...

 hope to hear from you soon...

regards, ashwin

0
Ivan Danchev
Telerik team
answered on 22 Jul 2015, 04:22 PM
Hello Ashwin,

The Site.master is not needed for testing this scenario as well as the whole Account folder. No manual compilation is required as the ASP.NET dynamically compiles web sites.

Please, find attached the modified sample page with added data binding to the RadComboBox controls. If you have issues running the previously attached web site you can use the .aspx and .aspx.cs files in a new project, as they contain all that is needed to test the behavior of the ComboBox SelectedIndexChanged event.

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Sanjeev
Top achievements
Rank 1
Answers by
Simon
Telerik team
Fabio
Top achievements
Rank 1
Terry
Top achievements
Rank 1
Domingo
Top achievements
Rank 1
ash
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or