RadComboBox SelectedIndexChanged fired incorrectly

13 posts, 0 answers
  1. Sanjeev
    Sanjeev avatar
    17 posts
    Member since:
    Jun 2007

    Posted 10 May 2010 Link to this post

    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

                

  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 13 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fabio
    Fabio avatar
    3 posts
    Member since:
    Sep 2010

    Posted 25 Oct 2010 Link to this post

    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.
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 02 Nov 2010 Link to this post

    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
  6. Terry
    Terry avatar
    5 posts
    Member since:
    Nov 2008

    Posted 10 Jan 2012 Link to this post

    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.
  7. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 16 Jan 2012 Link to this post

    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
  8. Domingo
    Domingo avatar
    1 posts
    Member since:
    Jun 2012

    Posted 20 Jun 2012 Link to this post

    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

     

  9. ash
    ash avatar
    4 posts
    Member since:
    Feb 2007

    Posted 13 Jul 2015 Link to this post

    Not again - Q2 2015

    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... 

  10. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 16 Jul 2015 Link to this post

    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
  11. ash
    ash avatar
    4 posts
    Member since:
    Feb 2007

    Posted 16 Jul 2015 in reply to Ivan Danchev Link to this post

    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

  12. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 21 Jul 2015 Link to this post

    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
  13. ash
    ash avatar
    4 posts
    Member since:
    Feb 2007

    Posted 21 Jul 2015 in reply to Ivan Danchev Link to this post

    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

  14. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 22 Jul 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017