RadComboBox in RadPanelBar firing SelectedIndexChanged when enabled

2 posts, 0 answers
  1. Patrik Johansson
    Patrik Johansson avatar
    277 posts
    Member since:
    May 2010

    Posted 28 Mar 2012 Link to this post

    We have a RadComboBox that is placed within a RadPanelBar with several RadPanelItems. We want to use it as a wizard, where you step through it step-by-step, to ensure this, the RadPanelItems are enabled one by one when clicking "next" in the previous one. What we have noticed is that when we enable a RadPanelItem (changing enabled=false to enabled=true) the RadComboBox will set it's SelectedValue to the first row, and will fire the SelectedIndexChanged() (thats how we can see that the selectedvalue has changed), but it still won't display with the first row. Please note that the MarkFirstMatch is set to false and AutoPostBack is set to true.

    So there are several strange things here, first, why does the SelectedValue change and the SelectedIndexChanged fire? And if it has changed, why isn't that row shown in the RadComboBox, instead it displays the "EmptyMessage" urging the user to select a row. (which we want).

    If we use the exact same code but does not disable the coming RadPanelItems, this problem won't occur. 

    This is our Next-function:

    private void GoToNextItem()
                int selectedIndex = RadPanelBar1.SelectedItem.Index;

                RadPanelBar1.Items[selectedIndex + 1].Selected = true;
                RadPanelBar1.Items[selectedIndex + 1].Expanded = true;
                RadPanelBar1.Items[selectedIndex + 1].Enabled = true;
                RadPanelBar1.Items[selectedIndex].Expanded = false;

     This is the example we have been looking at:
  2. Kate
    Kate avatar
    1898 posts

    Posted 02 Apr 2012 Link to this post

    Hi Patrik,

    In general in order for the SelectedIndexChanged event to fire you will need to have set the AutoPostBack property to true (as it is the case in your example and as explained in this help article). As far as I understand your issue, when you go to the next  PanelItem the SelectedIndexChange event fire immediately and thus changing the SelectedValue. I tested the issue that you describe with the code of the demo and I can not get the behavior that you get (you can see the attached video here). Can you please clarify what is the behavior that you are trying to achieve?   

    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.
Back to Top