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

RadComboBox in RadPanelBar firing SelectedIndexChanged when enabled

1 Answer 53 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
improwise
Top achievements
Rank 1
Iron
Iron
improwise asked on 28 Mar 2012, 04:14 PM
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:
http://demos.telerik.com/aspnet-ajax/panelbar/examples/applicationscenarios/accessingnestedcontrols/defaultcs.aspx

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 02 Apr 2012, 01:09 PM
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?   

Greetings,
Kate
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.
Tags
PanelBar
Asked by
improwise
Top achievements
Rank 1
Iron
Iron
Answers by
Kate
Telerik team
Share this question
or