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

Context Menu Position with Frame

10 Answers 157 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Praveen
Top achievements
Rank 1
Praveen asked on 26 Apr 2012, 12:43 PM
  Context menu getting cropped with Iframe. Is there any way to set the context menu position with iframe?

Please see the attached file for more info

10 Answers, 1 is accepted

Sort by
0
Praveen
Top achievements
Rank 1
answered on 30 Apr 2012, 12:32 PM
Any Update??
0
Kate
Telerik team
answered on 30 Apr 2012, 02:26 PM
Hello Praveen,

Did you try using the EnableScreenBoundaryDetection="true" property of the RadContextMenu control? If this does not help can you provide more details on the behavior that you are trying to achieve?

All the best,
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
Praveen
Top achievements
Rank 1
answered on 09 May 2012, 12:41 PM
doesn't work. Is there any way to show context menu on top just like attached file??
0
Kate
Telerik team
answered on 09 May 2012, 02:41 PM
Hi Praveen,

One way of how to implement this is by using custom css classes. However, this approach requires that  you have a fixed amount on RadMenuItems. If you have two menu items for instance you can use the selector below (in any other case you will need to either increase or decrease the margin):
<style type="text/css">
   div.RadMenu ul.rmVertical,
   div.RadMenu ul.rmHorizontal,
    div.RadMenu ul.rmRootScrollGroup,
     div.RadMenu_Context ul.rmHorizontal {
      margin: -65px 0 0;
}
    </style>

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
Eugen
Top achievements
Rank 1
answered on 15 Oct 2012, 01:44 AM
I have contextMenu of RadFilter inside iframe. The ContextMenu getting cropped on ScreenBoundaryDetection=true. Please take a look on screen short. The AutoScroll doesn't work inside iframe too.
0
Kate
Telerik team
answered on 17 Oct 2012, 02:04 PM
Hi Eugen,

I am not quite sure that I completely understand the issue that you get. Can you please provide some code that we can test locally as well as elaborate a bit more on how you would expect the RadContextMenu to behave?

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.
0
Eugen
Top achievements
Rank 1
answered on 08 Nov 2012, 03:04 PM
Here is the code that I mean.

Default.aspx:
<%@ Page Title="Startseite" Language="C#" MasterPageFile="~/Site.master" CodeBehind="Default.aspx.cs" Inherits="ContextMenuInIframe._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<iframe src="IframeContent.aspx">
</iframe>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadContextMenu ID="RadContextMenu1" EnableRootItemScroll="true" EnableScreenBoundaryDetection="true" EnableAutoScroll="true" runat="server">
<Targets>
<telerik:ContextMenuDocumentTarget />
</Targets>
</telerik:RadContextMenu>
</asp:Content>

Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace ContextMenuInIframe
{
    public partial class _Default : System.Web.UI.Page
    {
        protected override void OnLoad(EventArgs e)
        {
            for (int i = 1; i < 100; i++)
            {
                this.RadContextMenu1.Items.Add(new Telerik.Web.UI.RadMenuItem("Item" + i));
            }
 
            base.OnLoad(e);
        }
    }
}


IframeContent.aspx:

<%@ Page Language="C#" CodeBehind="IframeContent.aspx.cs" Inherits="ContextMenuInIframe.IframeContent" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadContextMenu ID="RadContextMenu1" EnableRootItemScroll="true" EnableScreenBoundaryDetection="true" EnableAutoScroll="true" runat="server">
            <Targets>
                <telerik:ContextMenuDocumentTarget />
            </Targets>
        </telerik:RadContextMenu>
    </form>
</body>
</html>

IframeContent.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace ContextMenuInIframe
{
    public partial class IframeContent : System.Web.UI.Page
    {
        protected override void OnLoad(EventArgs e)
        {
            for (int i = 1; i < 100; i++)
            {
                this.RadContextMenu1.Items.Add(new Telerik.Web.UI.RadMenuItem("Item" + i));
            }
 
            base.OnLoad(e);
        }
    }
}
0
Kate
Telerik team
answered on 13 Nov 2012, 03:36 PM
Hello Eugen,

I was able to replicate the issue that you described with the code provided. One possible solution that I can think of is to use the DefaultGroupSettings of the menu control. It will render scroll bars to the RadContextMenu that will allow you to view all of the items:
<telerik:RadContextMenu ID="RadContextMenu1" EnableRootItemScroll="true" EnableScreenBoundaryDetection="true" EnableAutoScroll="true" runat="server">
             <DefaultGroupSettings Height="200px" />
                 <Targets>
                  <telerik:ContextMenuDocumentTarget />
              </Targets>
          </telerik:RadContextMenu>

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
Eugen
Top achievements
Rank 1
answered on 14 Nov 2012, 08:45 AM
Thank You!

DefaultGroupSettings works for me. Is it possible to make the height automatically adjust to viewport size?
0
Kate
Telerik team
answered on 16 Nov 2012, 04:25 PM
Hi Eugen,

You can set the desired height to the scrollWrapElement using the following code:
function OnClientShown(sender, args) {
var scrollWrapElement = sender._getScrollWrapElement();
scrollWrapElement.style.height = "100px";
}

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.
Tags
TreeView
Asked by
Praveen
Top achievements
Rank 1
Answers by
Praveen
Top achievements
Rank 1
Kate
Telerik team
Eugen
Top achievements
Rank 1
Share this question
or