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

radajaxpanel inside RadMenuItem

1 Answer 44 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Matteo
Top achievements
Rank 1
Matteo asked on 05 Aug 2011, 03:59 PM
I've created an ascx control like this:
<telerik:RadAjaxPanel runat="server" ID="rpan">
    <div style="width: 400px;">
    <telerik:RadToolBar runat="server" ID="rToolBar"
        OnClientButtonClicking="onItemClicking" onbuttonclick="rToolBar_ButtonClick">
    </telerik:RadToolBar>
    </div>

    <telerik:RadTreeView runat="server" ID="rTree"
        Skin="Vista"
        DataFieldID="ID"
        DataFieldParentID="idParent"
        DataTextField="Cd_Menu"
        DataValueField="link"
        OnClientDoubleClick="OnDoubleClick"
        OnNodeEdit="RadTreeView1_NodeEdit"
        EnableDragAndDrop="false"
        EnableDragAndDropBetweenNodes="false"
        OnNodeDrop="RadTreeView1_HandleDrop"
        OnClientNodeClicked="onNodeClicked"
        OnClientNodeClicking="onNodeClicking"
        OnClientNodeDropping="onNodeDropping"
        OnClientNodeDragging="onNodeDragging"
        OnNodeDatabound="rTree_NodeDataBound">
    </telerik:RadTreeView>
</telerik:RadAjaxPanel>


I also have an aspx page with a RadMenu created at runtime with databinding.
I tried to add the ascx control inside a RadMenuItem server side:

Telerik.Web.UI.RadMenuItem subRmi = new Telerik.Web.UI.RadMenuItem();
subRmi.ItemTemplate = new FavouritesTemplate(this.Page);

I have declared this class inside the same aspx page:
class FavouritesTemplate : ITemplate
    {
        private Page _page = null;

        public FavouritesTemplate(Page page)
        {
            this._page = page;
        }

        public void InstantiateIn(System.Web.UI.Control container)
        {
            Favourites fav = ((Favourites)this._page.LoadControl("~/Web.UserControls/Favourites.ascx"));
            fav.ID = "favourites";
            container.Controls.Add(fav);
        }
    }

The ascx control inside the RadMenuItem is shown correctly but doesn't work properly.
Clicking on a RadToolBarButton the whole aspx page do postback instead of only the ascx content (because of RadAjaxPanel)

Putting the same ascx control directly inside the aspx page (not inside the the RadMenuItem) works as expected (partial postback of the ascx content)

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 10 Aug 2011, 03:53 PM
Hi Matteo,

adding a RadAjax control into an inner RadMenuItem is not fully supported scenario. In this case the whole RadMenu should be ajaxified. Pleas test the same approach using asp UpdatePanel and verify of the same behaviour could be observed.

Greetings,
Maria Ilieva
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.

Tags
Ajax
Asked by
Matteo
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or