Reputation: 1477
All:
Here are the technical details pertaining to our Development environment for our Web Application:
-Telerik version 2016.2.607.45
-Microsoft Visual Studio Enterprise 2015 Version 14.0.35123.00 Update 2
-.NET Framework 4.5 We are trying to integrate the Telerik “Grid - Excel-like Filtering” which can be seen by clicking on the following link:
The Telerik “Grid - Excel-like Filtering” looks like the following:
<%@ Page Language="c#" AutoEventWireup="false" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.GridExamplesCSharp.Functionality.Filtering.ExcelLikeFiltering. DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
<title>Telerik ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="true">
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" AllowFilteringByColumn="true" runat="server" FilterType="HeaderContext" EnableHeaderContextMenu="true"
EnableHeaderContextFilterMenu="true" AllowPaging="True" PagerStyle-AlwaysVisible="true" OnFilterCheckListItemsRequested="RadGrid1_FilterCheckListItemsRequested" DataSourceID="SqlDataSource1" AllowSorting="true" GroupingEnabled="true">
<MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="CustomerID">
<Columns>
<telerik:GridBoundColumn FilterCheckListEnableLoadOnDemand="true" DataField="ContactName" FilterControlAltText="Filter ContactName column" HeaderText="ContactName" SortExpression="ContactName" UniqueName="ContactName" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn FilterCheckListEnableLoadOnDemand="true" DataField="ContactTitle" FilterControlAltText="Filter ContactTitle column" HeaderText="ContactTitle" SortExpression="ContactTitle" UniqueName="ContactTitle">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Address" FilterControlAltText="Filter Address column" HeaderText="Address" SortExpression="Address" UniqueName="Address">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn FilterCheckListEnableLoadOnDemand="true" DataField="City" FilterControlAltText="Filter City column" HeaderText="City" SortExpression="City" UniqueName="City">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn FilterCheckListEnableLoadOnDemand="true" DataField="Country" FilterControlAltText="Filter Country column" HeaderText="Country" SortExpression="Country" UniqueName="Country">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</telerik:RadAjaxPanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT * FROM [Customers]"></asp:SqlDataSource>
</form>
</body>
</html>
Since yesterday, I've been trying to change values of various attribute of the Telerik tags in order to remove the Columns option. I've modified/removed, and placed back various Telerik tag attributes like FilterCheckListEnableLoadOnDemand, FilterControlAltText, etc., but it still would not remove the Columns option. Could someone please tell me what modifications in the code need to made in order to remove the Columns Option?
Upvotes: 0
Views: 1348
Reputation: 1
ASP
<HeaderContextMenu OnItemCreated="HeaderContextMenu_ItemCreated"></HeaderContextMenu>
C#
private void HeaderContextMenu_ItemCreated(object sender, RadMenuEventArgs e)
{
switch ((e.Item.Text))
{
case "Columns":
e.Item.Visible = false;
break;
}
}
VB.NET
Protected Sub HeaderContextMenu_ItemCreated(sender As Object, e As RadMenuEventArgs)
Select Case e.Item.Text
Case "Columns"
e.Item.Visible = False
End Select
End Sub
Upvotes: 0
Reputation: 2238
Unfortunately, as is the case with most of Telerik's more complicated functionality, this doesn't appear to be very customizable. Have you tried hiding it with CSS?
.RadMenu .rgHCMCols {
display:none !important;
}
You will probably have to get more specific with the selector, knowing how the Telerik skins work.
Upvotes: 1