Premmerce Documentation > Table or Grid > Disable Sorting for a Specific Column

About Premmerce

Introduction

Full Features

Installation

Prerequisite

Setup & Installation

Table or Grid

Basic Usage

Disable Column Sorting

Disable Column Export

Change Search Placeholder

Custom Column Template

Add Buttons to Action Column

Hyperlink Column Text

Specific Roles to View Column

Add or remove column

Filter column

CSS and JS

Edit Color

File validation

General

Password Validation

Bulk Import

Other

It’s easy. Let’s go! The steps:

  1. Go to Helpers folder > TableConfig.cs file
  2. Scroll to the specific TableConfig class
  3. Add Sortable = false to that column
  4. For example, Description column is not sortable:
public static class ImpactTableConfig
{
    // Specifies the columns to display in the table
    public static List<ColumnProperty> TableColumns = new List<ColumnProperty>() {
        new ColumnProperty { HeaderKey = nameof(ImpactViewModel.Ordering) },
        new ColumnProperty { HeaderKey = nameof(ImpactViewModel.Name) },
        new ColumnProperty { HeaderKey = nameof(ImpactViewModel.Description)**, Sortable = false** },
        new ColumnProperty { HeaderKey = nameof(ImpactViewModel.CreatedOn), IsDateTimeColumn = true, ValueKey = nameof(ImpactViewModel.IsoUtcCreatedOn)}
    };
}