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

Positioning radcontext menu sub menu with offset y position

3 Answers 266 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saikrishna
Top achievements
Rank 1
Saikrishna asked on 12 May 2014, 02:51 PM
Hi,

I have a rad context menu on HTML table cell, and I want to position the sub menu relative to the page rather than parent element. Because, if the user scrolls down to last row and right click for context menu, the sub menu is not showing full list, instead its height is set as very small (due to table cell position - browser bottom) with Up and Down arrows (image2 attached).

This is working fine, if the user clicks top cell of table (Image1)

Is it possible to alter the sub menu position, such that, it will be set with an offset to y position (something like in image3 attached)?

Many Thanks,
Saikrishna

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 May 2014, 05:50 AM
Hi Saikrishna,

Please try the following CSS to change the position of the RadContextMenu level 3. Yo can change the top value based on your requirement.

CSS:
<style type="text/css">
    .rmVertical .rmGroup .rmLevel3
    {
        top: -50% !important;
    }
    .rmSlide
    {
        top: 0 !important;
    }
</style>

Another suggestion is that you can use the showAt method of the context menu client-side object to show the menu at a per-defined position, as shown in the online demo.

Thanks,
Shinu.
0
Saikrishna
Top achievements
Rank 1
answered on 29 May 2014, 08:56 AM
Hi Shinu,

Sorry for not replying at the earliest.

Changing css is doing the trick. However, we have two rad context menus on the page. This change is impacting both the contextmenus.

Is there anything I can do to change only the required contextmenu (something in jQuery ??)

Regards,
Saikrishna
0
Accepted
Shinu
Top achievements
Rank 2
answered on 30 May 2014, 08:32 AM
Hi Saikrishna,

Please try to add a CssClass for the RadContextMenu  and change the style as follows.

ASPX:
<telerik:RadContextMenu ID="RadContextMenu" runat="server" CssClass="RadContextMenu1">
...
</telerik:RadContextMenu>

CSS:
.RadContextMenu1 .rmVertical .rmGroup .rmLevel3
{
    top: -50% !important;
}
.RadContextMenu1 .rmSlide
{
    top: 0 !important;
}

Thanks,
Shinu.
Tags
General Discussions
Asked by
Saikrishna
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Saikrishna
Top achievements
Rank 1
Share this question
or