Search results

Hide sorting options on Excel filter Dialog in ASP.NET Core Grid control

08 Dec 2021 / 1 minute to read

You can hide the sorting options on the excel filter dialog by setting display as none for the following classes.

Copied to clipboard
    .e-excel-ascending,
    .e-excel-descending,
    .e-separator.e-excel-separator {
    display: none;
    }
tagHelper
disable-sorting-excel.cs
Copied to clipboard
<ejs-grid id="Grid" dataSource="@ViewBag.DataSource" allowFiltering="true">
    <e-grid-filterSettings type="Excel" ></e-grid-filterSettings>
    <e-grid-columns>
        <e-grid-column field="OrderID" headerText="Order ID" textAlign="Right" width="120"></e-grid-column>
        <e-grid-column field="CustomerID" headerText="Customer ID" width="150"></e-grid-column>
        <e-grid-column field="ShipCity" headerText="Ship City" width="150"></e-grid-column>
        <e-grid-column field="ShipName" headerText="Ship Name" width="150"></e-grid-column>
    </e-grid-columns>
</ejs-grid>

<style>

    .e-excel-ascending,
    .e-excel-descending,
    .e-separator.e-excel-separator {
       display: none;
    }

</style>
Copied to clipboard
public IActionResult Index()
{
    ViewBag.DataSource = OrderDetails.GetAllRecords();
    return View();
}