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

Issue with Javascript code displaying Rad Context Menu

6 Answers 85 Views
Menu
This is a migrated thread and some comments may be shown as answers.
student
Top achievements
Rank 1
student asked on 06 May 2014, 06:14 PM
Hi,

I'm using a Rad Grid Control in which I want to display a Rad Context Menu. The Javascript function supposed displaying the Rad Context Menu in RadGrid throws an error message as soon as "menu.Show(evt)" is executed. The error message is "Microsoft JScript runtime error: Object doesn't support property or method 'Show' ".
It seems that the javascript code does not recognize my RadMenu1 control.
Here is the code for the function I'm using:

<script type="text/javascript">
function RowContextMenu(index, e) {
document.getElementById("radGridClickedRowIndex").value = index;
 
var menu = $find("<%=RadMenu1.ClientID %>");
  var evt = e.get_domEvent();

menu.Show(evt);

e.cancelBubble = true;
e.returnValue = false;

if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
this.SelectRow(this.Rows[index].Control, true);
}
</script>

Please, How do I fix this?
Thanks,

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 07 May 2014, 04:57 AM
Hi,

Unfortunately I couldn't replicate the issue at my end. Please try the following JavaScript which works fine at my end. I am using Latest Telerik version ,can you please tell the version you are using.

JavaScript:
function RowContextMenu(sender, eventArgs) {
    var menu = $find("<%=RadMenu1.ClientID %>");
    var evt = eventArgs.get_domEvent();
    var index = eventArgs.get_itemIndexHierarchical();
    menu.show(evt);
    evt.cancelBubble = true;
    evt.returnValue = false;
    if (evt.stopPropagation) {
        evt.stopPropagation();
        evt.preventDefault();
    }
}

Please provide your full code if it doesn't help.
Thanks,
Shinu.
0
student
Top achievements
Rank 1
answered on 07 May 2014, 12:19 PM
Hi,

I'm using the version 2014.1.403.40.
Here is my full code:
--------------
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="TAT_TracerList.aspx.vb"
Inherits="TracerList" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik"%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="Common/TATStyleSheet.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function RowContextMenu(index, e) {
document.getElementById("radGridClickedRowIndex").value = index;
//var menu = <%=RadMenu1.ClientID %>;
var menu = $find("<%=RadMenu1.ClientID %>");

var evt = e.get_domEvent();

menu.Show(evt);

e.cancelBubble = true;
e.returnValue = false;

if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
this.SelectRow(this.Rows[index].Control, true);
}
</script>
</telerik:RadScriptBlock>

<br />
<telerik:RadContextMenu ID="RadMenu1" runat="server" IsContext="True"
ResolvedRenderMode="Classic" OnItemClick="RadMenu1_ItemClick"
ContextMenuElementID="none">
<Items>
<telerik:RadMenuItem runat="server" Text="Conduct Tracer">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Edit">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Delete">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="Assign Tracer To...">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="View as PDF">
</telerik:RadMenuItem>
<telerik:RadMenuItem runat="server" Text="View Data">
</telerik:RadMenuItem>
</Items>
</telerik:RadContextMenu>

<input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />

<br />
<asp:Table ID="Table1" runat="server" width="100%" >
<asp:TableRow runat="server">
<asp:TableCell runat="server" HorizontalAlign="Left" Width="70%" >
<asp:Button ID="AddNewBtn" runat="server" Text="Add New" />
</asp:TableCell>
<asp:TableCell ID="TableCell1" runat="server" HorizontalAlign="left" Width="30%">
<asp:Image ID="Image1" runat="server" Width="30px"
ImageUrl="~/Images/help2.png" />
<telerik:RadListBox ID="FilterRadListBox" runat="server" CssClass="horizontalListbox"
ResolvedRenderMode="Classic" BorderColor="White" Font-Bold="True" >
<ButtonSettings TransferButtons="All"></ButtonSettings>
<Items>
<telerik:RadListBoxItem runat="server" BackColor="White" Enabled="False"
Font-Overline="False" ListBox="FilterRadListBox" Text="Filter : " />
<telerik:RadListBoxItem runat="server" Text="All" Selected="True" />
<telerik:RadListBoxItem runat="server" Text="Active" />
<telerik:RadListBoxItem runat="server" Text="Pending" />
<telerik:RadListBoxItem runat="server" Text="Complete" />
</Items>
</telerik:RadListBox>
</asp:TableCell>
</asp:TableRow >
</asp:Table>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="3">
<ItemStyle BackColor="LightGray"/>
<AlternatingItemStyle BackColor="LightGray"/>
<HeaderStyle CssClass="Myheader" />
<ClientSettings>
<ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>

<br />
<asp:Button ID="Button2" runat="server" Text="Button" /> <br />

</asp:Content>
--------------------

Thanks,
0
Accepted
Shinu
Top achievements
Rank 1
answered on 08 May 2014, 04:28 AM
Hi,

Please do the following modification in your JavaScript which works fine at my end.

JavaScript:
<script type="text/javascript">
    function RowContextMenu(index, e) {
        document.getElementById("radGridClickedRowIndex").value = index;
        var menu = $find("<%=RadMenu1.ClientID %>");
        var evt = e.get_domEvent();
        menu.show(evt);
        //your code
    }
</script>

Thanks,
Shinu.
0
student
Top achievements
Rank 1
answered on 08 May 2014, 02:19 PM
Ok, Thanks.
0
Vishu
Top achievements
Rank 1
answered on 27 Aug 2014, 07:56 PM
Hi,
Currently using contextmenu with static headers and getting JS error in Telerik.Web.UI.WebResource.axd file after enabling radgrid property allowscroll=true. Error says object required for Multiheader cells. Is it a known issue?

Please see attached screen shot. Have tried with 2014 Q1 and Q2 libraries but still issue persists. 

Aspx:
<telerik:RadGrid ID="gridItemsSearch" runat="server" PageSize="20" AllowPaging="true" HeaderStyle-Font-Underline="true" AllowCustomPaging="true" OnPageIndexChanged="gridItemsSearch_PageIndexChanged" 
                             AutoGenerateColumns="False" Skin="Office2007" OnItemCommand="gridItemsSearch_OnItemCommand" Visible="true" OnSortCommand="gridItemsSearch_SortCommand" EnableHeaderContextMenu="true" 
                            OnNeedDataSource="gridItemsSearch_NeedDataSource" ExportSettings-FileName="ItemParts" OnItemDataBound="gridItemsSearch_ItemDataBound"  Width="1855px" 
                            OnPreRender="gridItemsSearch_PreRender"  AllowSorting="true" CellPadding="2" ShowFooter="false" ExportSettings-ExportOnlyData="false">                            
                            <PagerStyle Mode="NextPrevAndNumeric" Position="Top" ></PagerStyle>
                            <MasterTableView ShowHeadersWhenNoRecords="true" AllowSorting="true" AllowMultiColumnSorting="false" AllowNaturalSort="true" UseAllDataFields="false" ItemStyle-Height="5px" EnableColumnsViewState="true" TableLayout="Fixed" 
                                DataKeyNames="ItemNumber" Width="99.5%">       
                                <ColumnGroups>
                                    <telerik:GridColumnGroup HeaderText="" Name="ItemDesc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="Available" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="Allocated" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="Onhand" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="OnOrder" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="AvgCost" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="6MON" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="12MON" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="AROR" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="Branch" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="BrDesc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="ItemId" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="SUOM" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="PrefVend" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="OemNo" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="OEM" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="ReorderPt" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="Critical" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="VMRS" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="CoreVal" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                    <telerik:GridColumnGroup HeaderText="" Name="PrintBC" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Bold="true"></telerik:GridColumnGroup>
                                </ColumnGroups>                                                 
                                <Columns>                                   
                                    <telerik:GridTemplateColumn SortExpression="ItemNumber" DataField="ItemNumber" HeaderText=""
                                        UniqueName="ChkItemNumber" HeaderStyle-Width="30px">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgpickItem" runat="server" ToolTip="Click to add to Kit Contents" ImageUrl="~/images/basket_add.png" 
                                                CommandName="Select" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                     <telerik:GridTemplateColumn HeaderText="#" UniqueName="RowNumber" Visible="false" HeaderStyle-Width="10px">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblRowNumber" Width="50px" Text='<%# Container.DataSetIndex+1 %>'></asp:Label>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <%-- Newly Added columns are following --%>
                                     <telerik:GridBoundColumn DataField="Branch" HeaderText="Branch" SortExpression="Branch" HeaderStyle-Width="70px"   ColumnGroupName="Branch"
                                        UniqueName="BranchId" ItemStyle-HorizontalAlign="Left" />
                                     <telerik:GridBoundColumn DataField="BranchDesc" HeaderText="Branch Description" SortExpression="BranchDesc" HeaderStyle-Width="70px"  ColumnGroupName="BrDesc"
                                        UniqueName="BranchName" ItemStyle-HorizontalAlign="Left"/>
                                    <%-- Newly added columns adding ends --%>
                                    <telerik:GridBoundColumn DataField="ItemNumber" HeaderText="Item ID" HeaderStyle-Width="45px" ColumnGroupName="ItemId"
                                        UniqueName="ItemNumber" ItemStyle-HorizontalAlign="Left" SortExpression="ItemNumber"/>                                   
                                    <telerik:GridBoundColumn DataField="ItemDescription" HeaderText="Item Description" UniqueName="ItemDescription" HeaderStyle-Width="70px"  ColumnGroupName="ItemDesc"
                                        ItemStyle-HorizontalAlign="Left" SortExpression="ItemDescription" />
                                    <telerik:GridBoundColumn DataField="Group" UniqueName="Group" Visible="false" />
                                    <telerik:GridBoundColumn DataField="Available" HeaderText="Available"  SortExpression="Available" DataType="System.Double" HeaderStyle-Width="90px"  ColumnGroupName="Available"
                                        ItemStyle-HorizontalAlign="Center" UniqueName="Available" />
                                    
                                    <telerik:GridBoundColumn DataField="READYFORRENT_QTY" HeaderText="Assets Ready for Rent"  DataType="System.Double" HeaderStyle-Width="70px"  ColumnGroupName="AROR"
                                        ItemStyle-HorizontalAlign="Center" UniqueName="READYFORRENT_QTY" SortExpression="READYFORRENT_QTY" />
                                    
                                    <telerik:GridBoundColumn DataField="Allocated" HeaderText="Allocated" SortExpression="Allocated" 
                                        ItemStyle-HorizontalAlign="Center" UniqueName="Allocated" Visible="false"/>
                                    
                                    <telerik:GridTemplateColumn DataField="Allocated" HeaderText="Allocated" UniqueName="AllocatedPopup" SortExpression="Allocated"  ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70px"  ColumnGroupName="Allocated">
                                        <ItemTemplate>                                                        
                                            <asp:LinkButton ToolTip="Allocated Quantity" runat="server" ID="lnkSelectAllocated" OnClick="BtnSelectItemAllocationData_Click" Visible="true" Text='<%# Eval("Allocated") %>' OnClientClick="GridProcessingText()"/>
                                            <asp:Label ID="lblAllocated" runat="server" Visible="false" Text='<%# Eval("Allocated") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>                                   

                                     <telerik:GridTemplateColumn DataField="QtyOnHand" HeaderText="On Hand" UniqueName="OnHand"  ItemStyle-HorizontalAlign="Center" SortExpression="QtyOnHand" HeaderStyle-Width="70px"  ColumnGroupName="Onhand">
                                        <ItemTemplate>
                                                <asp:LinkButton Text='<%# Eval("QtyOnHand") %>' runat="server"  ID="BtnSelectItemLocation" OnClick="BtnSelectItemLocation_Click" Visible="true" ToolTip="Click to see item storage location" OnClientClick="GridProcessingText()" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>

                                    <telerik:GridBoundColumn DataField="OnOrder" HeaderText="On Order"  SortExpression="OnOrder" HeaderStyle-Width="70px"  ColumnGroupName="OnOrder"
                                        ItemStyle-HorizontalAlign="Center" UniqueName="OnOrder" />
                                     <telerik:GridBoundColumn DataField="AverageCost" HeaderText="Average Cost" DataType="System.Double" DefaultInsertValue="0.0" HeaderStyle-Width="70px" ColumnGroupName="AvgCost"
                                        ItemStyle-HorizontalAlign="Center" UniqueName="AverageCost" SortExpression="AverageCostActualValue"/>
                                     <telerik:GridBoundColumn DataField="SixMonthUsage" HeaderText="6 Month Usage" SortExpression="SixMonthUsage" HeaderStyle-Width="90px"  ColumnGroupName="6MON"
                                        ItemStyle-HorizontalAlign="Center" UniqueName="SixMonthUsage"/>

                                      <telerik:GridTemplateColumn DataField="TwelveMonthUsage" HeaderText="12 Month Usage" UniqueName="TwelveMonthUsage" SortExpression="TwelveMonthUsage" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="70px"  ColumnGroupName="12MON">
                                        <ItemTemplate>                                                        
                                            <asp:LinkButton ToolTip="12 Month Usage" runat="server" ID="lnkSelect12MonUsage" OnClick="BtnSelectItem12MonUsage_Click" Visible="true" Text='<%# Eval("TwelveMonthUsage") %>' OnClientClick="GridProcessingText()"/>
                                            <asp:Label ID="lbl12MonUsage" runat="server" Visible="false" Text='<%# Eval("TwelveMonthUsage") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>                                      

                                    <telerik:GridBoundColumn DataField="UnitOfMeasure" HeaderText="Standard UOM" HeaderStyle-Width="90px"  ColumnGroupName="SUOM"
                                        ItemStyle-HorizontalAlign="Left" UniqueName="UnitOfMeasure" SortExpression="UnitOfMeasure" />
                                                                 
                                     <telerik:GridTemplateColumn DataField="VendorName" HeaderText="Preferred Vendor" UniqueName="VendorName" ItemStyle-HorizontalAlign="Left" SortExpression="VendorName" HeaderStyle-Width="90px" ColumnGroupName="PrefVend">
                                        <ItemTemplate>
                                             <asp:LinkButton ToolTip="Click to see additional vendors" runat="server" ID="BtnSelectVendor" OnClick="BtnSelectVendor_Click" Visible="true" Text='<%# Eval("VendorName") != "" ? Eval("VendorName") : "" %>' OnClientClick="GridProcessingText()"/>                                             
                                        </ItemTemplate>
                                      </telerik:GridTemplateColumn>

                                     <telerik:GridBoundColumn DataField="OEMPartNo" HeaderText="OEM Part #" UniqueName="OEMPart" SortExpression="OEMPartNo" HeaderStyle-Width="70px"  ColumnGroupName="OemNo"
                                        ItemStyle-HorizontalAlign="Left" />
                                                                  
                                      <telerik:GridTemplateColumn DataField="OEM" HeaderText="OEM" UniqueName="OEM" ItemStyle-HorizontalAlign="Center" SortExpression="OEM" HeaderStyle-Width="90px" ColumnGroupName="OEM">
                                        <ItemTemplate>
                                                <asp:LinkButton ToolTip="Click to see additional manufacturers" runat="server" ID="BtnSelectItemOEMData" OnClick="BtnSelectItemOEMData_Click" Visible="true" Text='<%# Eval("OEM") != "" ? Eval("OEM") : "" %>'  OnClientClick="GridProcessingText()"/>                                                 
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>                                     
                                                                   
                                    <telerik:GridBoundColumn DataField="ReorderPoint" HeaderText="Reorder Point" HeaderStyle-Width="70px"   ColumnGroupName="ReorderPt" 
                                        ItemStyle-HorizontalAlign="Center" UniqueName="ReorderPoint" SortExpression="ReorderPoint" />                                                                   
                                   
                                     <telerik:GridTemplateColumn HeaderText="Critical Item" ItemStyle-HorizontalAlign="Center" UniqueName="CriticalItem" SortExpression="CriticalItem" HeaderStyle-Width="70px"   ColumnGroupName="Critical">
                                        <ItemTemplate>
                                                <asp:CheckBox ID="BtnSelectCriticalItem" runat="server" Enabled="false"  Checked='<%# Eval("CriticalItem").ToString()  == "Y" ? true : false %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>

                                     <telerik:GridBoundColumn DataField="VRMSFullCode" HeaderText="VMRS Code"  SortExpression="VRMSFullCode" HeaderStyle-Width="70px"  ColumnGroupName="VMRS"
                                        ItemStyle-HorizontalAlign="Left" UniqueName="VRMSFullCode"/>
                                    <telerik:GridBoundColumn DataField="IsPMKitItem" HeaderText="PM Kit"  SortExpression="IsPMKitItem" Visible="false" HeaderStyle-Width="70px" 
                                        ItemStyle-HorizontalAlign="Left" UniqueName="IsPMKitItem"/>
                                     <telerik:GridBoundColumn DataField="CoreValue" HeaderText="Core Value"  HeaderStyle-Width="70px"   ColumnGroupName="CoreVal"
                                        ItemStyle-HorizontalAlign="Left" UniqueName="CoreValue" SortExpression="CoreValue" />
                                     <telerik:GridTemplateColumn DataField="PrintBarCode" HeaderText="Print Barcode" UniqueName="PrintbarcodeLinkLevel1" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="40px" ColumnGroupName="PrintBC">                                     
                                        <ItemTemplate>                                                                
                                            <asp:ImageButton ID="PrintbarcodeLinkInventory" runat="server"  ImageUrl="~/Images/Print.png" ToolTip="Print Barcode"/>
                                        </ItemTemplate>
                                     </telerik:GridTemplateColumn>  
                                                                        
                                    <telerik:GridBoundColumn DataField="Family" HeaderText="Family" SortExpression="Family" Visible="false"
                                        ItemStyle-HorizontalAlign="Left" UniqueName="Family"/>
                                    <telerik:GridBoundColumn DataField="Category" HeaderText="Category" SortExpression="Category" Visible="false"
                                        ItemStyle-HorizontalAlign="Left" UniqueName="Category"/>
                                    <telerik:GridBoundColumn DataField="Group" HeaderText="Group" SortExpression="Group" Visible="false"
                                        ItemStyle-HorizontalAlign="Left" UniqueName="Group"/> 
                                                                                                               
                                      <telerik:GridBoundColumn DataField="StorageArea" HeaderText="Storage Area" Visible="false"
                                        UniqueName="StorageArea" ItemStyle-HorizontalAlign="Left" SortExpression="StorageArea" />
                                      <telerik:GridBoundColumn DataField="IsInventoryItem" HeaderText="Inventory Item" Visible="false"
                                        UniqueName="IsInventoryItem" ItemStyle-HorizontalAlign="Left" SortExpression="IsInventoryItem" />   
                                    <telerik:GridBoundColumn DataField="AverageCostActualValue" HeaderText="Avg Cose" Visible="false" 
                                        UniqueName="AverageCostActualValue" ItemStyle-HorizontalAlign="Left" SortExpression="AverageCostActualValue" DataType="System.Decimal"/>    
                                    <telerik:GridBoundColumn DataField="Parent" HeaderText="Parent" Visible="false" 
                                        UniqueName="Parent" ItemStyle-HorizontalAlign="Left" SortExpression="Parent"/>    
                                    <telerik:GridBoundColumn DataField="Child1" HeaderText="Child1" Visible="false" 
                                        UniqueName="Child1" ItemStyle-HorizontalAlign="Left" SortExpression="Child1"/>    
                                    <telerik:GridBoundColumn DataField="Child2" HeaderText="Child2" Visible="false" 
                                        UniqueName="Child2" ItemStyle-HorizontalAlign="Left" SortExpression="Child2"/>    
                                    <telerik:GridBoundColumn DataField="Child3" HeaderText="Child3" Visible="false" 
                                        UniqueName="Child3" ItemStyle-HorizontalAlign="Left" SortExpression="Child3"/>
                                     <telerik:GridBoundColumn DataField="UltimateParent" HeaderText="UltimateParent" Visible="false" 
                                        UniqueName="UltimateParent" ItemStyle-HorizontalAlign="Left" SortExpression="UltimateParent"/>                                                                      
                                </Columns>
                            </MasterTableView>
                            <SortingSettings EnableSkinSortStyles="false" />
                             <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder">                                 
                                <Resizing AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="true"
                                    ClipCellContentOnResize="true" EnableRealTimeResize="false" AllowResizeToFit="true" />
                                 <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="500px" SaveScrollPosition="true" />
                                 <ClientEvents OnColumnClick="GridSortProcessingText" OnCommand="GridCommand" /> 
                                 <ClientMessages DragToGroupOrReorder="Drag to reorder" />    
                                 <Selecting AllowRowSelect="True" />      
                                 <ClientEvents  />                                                                                         
                            </ClientSettings>
                        </telerik:RadGrid>

ASPX.CS:
void HeaderContextMenu_ItemCreated(object sender, RadMenuEventArgs e)
       {
           RadContextMenu menu = gridItemsSearch.HeaderContextMenu;
           foreach (RadMenuItem item in menu.Items)
           {
               if (item.IsSeparator)
               {
                   item.Visible = false;
               }
           }
           switch ((e.Item.Text))
           {
               case "Clear Sorting":
                   e.Item.Visible = false;
                   break;

               case "Sort Ascending":
                   e.Item.Visible = false;
                   break;

               case "Sort Descending":
                   e.Item.Visible = false;
                   break;

               case "Group By":
                   e.Item.Visible = false;
                   break;

               case "Ungroup":
                   e.Item.Visible = false;
                   break;
           }
       }

protected void Page_Load(object sender, EventArgs e)
        {           
            gridItemsSearch.HeaderContextMenu.ItemCreated += new RadMenuEventHandler(HeaderContextMenu_ItemCreated);
        }












0
Eyup
Telerik team
answered on 01 Sep 2014, 12:38 PM
Hello Vishu,

Your assumption is correct. I am afraid currently Multi-headers are not supported with Frozen columns:
http://www.telerik.com/help/aspnet-ajax/grid-multicolumn-headers.html

You can log your requirement as a feature request in our public portal and our developers may consider including it for the future releases:
http://feedback.telerik.com/Project/108


Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Menu
Asked by
student
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
student
Top achievements
Rank 1
Vishu
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or