We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can I change the font family of a Grid's ContextMenu ?

Hi,
How can I change the font family of a Grid's ContextMenu ?

<ej:Grid ID="Grid1" runat="server">
    <ContextMenuSettings EnableContextMenu="true" DisableDefaultItems="true">
        <CustomContextMenuItem>
            <ej:CustomContexMenuItems Id="DetailsCustomContexMenuItem1" Text="Details 1" /> 
            <ej:CustomContexMenuItems Id="DetailsCustomContexMenuItem2" Text="Details 2" /> 
        </CustomContextMenuItem>
    </ContextMenuSettings>
    <Columns>
        <ej:Column Field="id" Visible="false" />
        <ej:Column Field="time" HeaderText="Time"/>
    </Columns>
</ej:Grid>


Thanks,
   Tomer

3 Replies

VN Vignesh Natarajan Syncfusion Team August 31, 2017 11:03 AM UTC

Hi Tomer, 

Thanks for contacting Syncfusion support 

Query: “How can I change the font family of a Grid's ContextMenu ?”  

We have achieved your requirement by setting font-family css style to custom Content Menu list using style tag as show in code snippet below  

<style type="text/css"> 
       .e-context.e-menu .e-list>a.e-menulink 
       { 
           font-family:'Vladimir Script'; 
       } 
   </style> 
   
We have prepared a sample based on your requirement, the same can be downloaded from below link 

Please refer the below screenshot for font-family changed to context menu list. 

 

Regards, 
Vignesh Natarajan. 




TO tomer August 31, 2017 12:29 PM UTC

Doesn't work for me.


Maybe because i'm using version 14.1460.0.46 ?


Here is the aspx page:


<%@ Page Title="GridTest3" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="GridTest3.aspx.cs" Inherits="GridTest3" %>

<%@ Register assembly="Syncfusion.EJ.Web, Version=14.1460.0.46, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Web" tagprefix="ej" %>

<%@ Register Assembly="Syncfusion.EJ, Version=14.1460.0.46, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Models" TagPrefix="ej" %> 


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div id = "ControlRegion">

<div class="frame ">

    <div>

        <ej:Grid ID="Grid1"  AllowPaging="True" AllowScrolling="true" runat="server">

            <ContextMenuSettings EnableContextMenu="true" DisableDefaultItems="true">

                    <CustomContextMenuItem>

                        <ej:CustomContexMenuItems Id="clear" Text="Clear Selection" /> 

                    </CustomContextMenuItem>

                </ContextMenuSettings>

            <Columns>

                <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true"  TextAlign="Right" Width="120" />

                <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="150"  />

                <ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Right" Width="130"  />

                <ej:Column Field="Freight" HeaderText="Freight"  TextAlign="Right" Width="150" Format="{0:C}" />

                <ej:Column Field="OrderDate" HeaderText="Order Date" Width="160"   TextAlign="Right" Format="{0:MM/dd/yyyy}" />

                

            </Columns>            

              <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"></EditSettings>

            

        </ej:Grid>

    </div>

   <style type="text/css">

       .e-context.e-menu .e-list>a.e-menulink

       {

           font-family:Arial;

           font-size:x-large;

       }

   </style>


        </div>

</div>

</asp:Content>



Thanks, 

  Tomer



VA Venkatesh Ayothi Raman Syncfusion Team September 1, 2017 06:22 AM UTC

Hi Tomer, 

Thanks for the update. 

We have added the ‘.e-menulink’ class in our latest Essential Studio version. But you are using Essential Stduio  v14.1.0.46. In that version, “.e-menulink” has not added for the context menu items. This is the cause of the issue and we suggest you to following code example for your requirement, 

<style type="text/css">  
       .e-context.e-menu .e-list>a 
       {  
           font-family:'Vladimir Script';  
       }  
   </style>  
 

Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon