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

RadMenu Items are not displayed properly in RADGRID

2 Answers 188 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Ajit
Top achievements
Rank 1
Ajit asked on 16 Nov 2013, 02:29 PM

Hello Telerik Support Team,


Having some issues with RadMenu control. Please have a look on code block and attached screenshots.
Issue – RadMenu items are not displayed properly in RadGrid. No idea how it’s taking grid row’s height and width. I have tried to override RadMenu css but still same issues.

Regards,

Ajit Singh

----------------  ASPX and CSS CODE-----------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication6.WebForm1" %>
<%@ 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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .MasterTable_Default caption {
            color: red;
            background-color:Black;
            text-align:left;
        }  
        .leftNavigatorstlye-Link
        {
            background-color:#0071bc;
            font-size: 12px;
            text-decoration: none;
            font-family: Segoe UI, Helvetica, Garuda, Arial, sans-serif;
            font-weight: bold;
            color:White;
        }
        .RadGrid_Default .rgHeader,
        .RadGrid_Default th.rgResizeCol
        {
         background:url('Grid/headers.gif') repeat-x #434343 !important;
            font-size: 12px !important;
            text-decoration: none !important;
            font-family: Segoe UI, Helvetica, Garuda, Arial, sans-serif !important;
            font-weight: bold !important;
            color:White !important;
        }
</style>
</head>
<body>
   
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    <table id="maintable" runat="server" style="width:100%;border-spacing:0;border-collapse:separate;">
        <tr><td class="leftNavigatorstlye-Link">My Task</td></tr>
        <tr>
            <td>
                <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowMultiRowSelection="True"
                    runat="server" AllowSorting="True" GridLines="None" AllowPaging="True" CellSpacing="0"
                        ShowGroupPanel="True" onitemcommand="RadGrid1_ItemCommand"  >
                    <MasterTableView CommandItemDisplay="Top"  CssClass="MasterTable_Default" HeaderStyle-CssClass="rgHeader" TableLayout="Fixed" >
                        <CommandItemTemplate>
                            <asp:LinkButton ID="LinkButton6" runat="server" CommandName="Rebind">
                                <img style="border:0px; height:22px;width:22px;" alt="" src="RefreshList.gif" />
                            </asp:LinkButton>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Rebind">
                                Global Actions
                            </asp:LinkButton>
                            <br />
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridTemplateColumn>
                                <ItemTemplate>
                                    <telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true"
                                        ExpandAnimation-Type="None" CollapseAnimation-Type="None" ExpandDelay="0" CollapseDelay="0"  >
                                        <Items>
                                            <telerik:RadMenuItem Text="Actions" Selected="false">
                                                <GroupSettings ExpandDirection="Right"  />
                                                <Items >
                                                    <telerik:RadMenuItem Text="View Process" />
                                                    <telerik:RadMenuItem Text="Cancel Task" />
                                                    <telerik:RadMenuItem Text="Reassign task" />
                                                    <telerik:RadMenuItem Text="Create Linked Work Item" />
                                                </Items>
                                            </telerik:RadMenuItem>
                                        </Items>
                                    </telerik:RadMenu>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="True">
                        <Selecting AllowRowSelect="True"></Selecting>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>           
            </td>
        </tr>
    </table>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [USER_NAME],[FULL_NAME],[DEPARTMENT],[EMAIL_ADDRESS],[MANAGER],[GROUP_NAME] FROM [tUsers]"></asp:SqlDataSource>
<br /><br />

</div>
    </form>
</body>
</html>

--------------------------------  CODE BEHIND------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace WebApplication6
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Rebind")
            {
                RadGrid1.Rebind();
            }

        }
    }
}

 

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Nov 2013, 07:26 AM
Hi Ajit,

I was able to reproduce the issue. Please try setting TableLayout as Auto and UseStaticHeaders as false. Setting these properties I was able to view the Menu Items.

Thanks,
Princy
0
SHUAN
Top achievements
Rank 1
answered on 21 Nov 2013, 04:02 AM
Thanks Princy... it's working as expected now...
Tags
Menu
Asked by
Ajit
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
SHUAN
Top achievements
Rank 1
Share this question
or