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

Panel fails to expand if I use OnItemClicked and ContentTemplate

9 Answers 81 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 13 Sep 2011, 12:22 PM
I'm using the Telerik.Web.UI dll version v2011.2.712.35 and have a RadPanelBar that has 5 RadPanelItems.

3 of these items have an items collection in them which will be used to nvaigate around my site.
The RadPanelBar has the OnItemClicked handler configured so that the RadPanelItems can be acted upon once clicked.

The other 2 will be used as login and account detail panels. Only one will be visible depending on the state of the user (logged in or not).

The "Logged In" panel has an Items collection and makes use of the OnItemsClicked even handler mentioned above for its items.

The "Not Logged In" panel has a ContentTemplate configured in such a way as to show a small login form, consisting of 2 RadTextBoxes and a RadButton.

Now, heres the problem.

If the user is not logged in, the panel with the ContentTemplate is visible, and if the user then clicks anywhere on that panels header to expand it - other than on the arrow - the then panel doesnt expand. If the user clicks the arrow icon on the panel then it does expand.
But if the user clicks on any of the other visible RadPanelItems headerbars they do expand regardless of where on the headeer they click.

It seems that if you use the OnItemClicked handler to handle events in your RadPanelBar, and any of the RadPanelItems uses a ContentTemplate, then the expand/collapse features misbehave unless you specifically click the icon in the header.

Has anyone else experienced this, or does anyone know how to fix it?

9 Answers, 1 is accepted

Sort by
0
Karl
Top achievements
Rank 1
answered on 13 Sep 2011, 02:34 PM
Quick update...

Have also noticed that when the arrow is used to expand the panel with the ContentTemplate in, clicking the arrow to collapse it won't work, but clicking anywhere else on the header will?

Given that my RadPanelBar has theExpandMode property is set to SingleExpandedItem and AllowCollapseAllItems is set to false, surely I shouldn't be allowed to collapse this panel at all?

Very odd...
0
Kate
Telerik team
answered on 16 Sep 2011, 11:23 AM
Hi Karl,

It looks like the scenario that you describe is very customized one and the information that you provide in not sufficient to reproduce the issue that you encounter. Also since there could be many reasons causing this issue my suggestion would be to open a support ticket and send us a simplified runnable project (containing only the very necessary controls that are needed) where we could inspect the issue and determine the proper behavior of the control in the context of your scenario.

Greetings,
Kate
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0
Karl
Top achievements
Rank 1
answered on 16 Sep 2011, 02:48 PM
It really isn't that custom to be honest, infact I would go so far as to say this would be fairly standard behaviour.

I will open a ticket and upload my test project so you can see for yourself...
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 18 Sep 2011, 02:15 AM
If you open up firefox\firebug in the Console tab...there are no script errors?
0
Karl
Top achievements
Rank 1
answered on 19 Sep 2011, 12:30 PM
Hi Steve, 

No script errors, but I do have 9 WebResource.axd warnings along with 2 of my own css warnings for "top" and "left".

I have a ticket open with Telerik now. Hopefully I'll hear something soon.
0
Kate
Telerik team
answered on 21 Sep 2011, 10:31 AM
Hi Karl and Steve,

As I wrote in the ticket that I sent earlier to Karl the behavior that you experience is a bug of the RadPanelBar control that I already logged in our internal system so it can be fixed.

Regards,
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
0
Shonda
Top achievements
Rank 1
answered on 11 Oct 2011, 07:51 PM
I just ran into this one myself and have noticed that I am never even getting into my ItemClick method.  Any ideas when the will be fixed?
0
Kate
Telerik team
answered on 12 Oct 2011, 09:05 AM
Hello Shonda,

I addressed the issue to our development team, however I can not give any time frame when the bug will be fixed. They are currently doing their best, so please, wait until the beta release of the controls and check if it has been resolved.   

Kind regards,
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
0
Karl
Top achievements
Rank 1
answered on 12 Oct 2011, 04:49 PM
Shonda, something you might want to look at in the time being is this...

I have noticed that when a header is clicked, The e.Item.Expanded value is set to true for normal RadPanelItems that contain an Items collection, but for those that have a ContentTemplate, this value is false.

If I alter the ItemClicked event to change the e.Item.Expanded value to true for RadPanelItems that have a ContentTemplate, then things behave as expected.

protected void ItemClicked(object sender, RadPanelBarEventArgs e)
{
    switch (e.Item.Value)
    {
        case "Login"//ContentTemplate Item
            e.Item.Expanded = true;
            //Possible method call here...
            break;
        case "Logout"//Items Collection Item
            Logout();
            break;
        case "Other option"//Items Collection Item
            //Do something else
            break;
    }
}
Tags
PanelBar
Asked by
Karl
Top achievements
Rank 1
Answers by
Karl
Top achievements
Rank 1
Kate
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Shonda
Top achievements
Rank 1
Share this question
or