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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disable filtering on one column in Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

149322 Nov 21,2019 03:53 PM UTC Nov 29,2019 03:46 AM UTC Blazor 3
loading
Tags: Grid
Junaid
Asked On November 21, 2019 03:53 PM UTC

Good day,

I have five columns in Grid. I am filtering the columns using an API, but I want to disable filtration on one of the columns in the grid. Like there should be no filtration textbox showing for this column in the Grid.

How can I do that?

Thanks.

Vignesh Natarajan [Syncfusion]
Replied On November 22, 2019 09:12 AM UTC

Hi Junaid,  

Thanks for contacting Syncfusion forums.  

Query: “I want to disable filtration on one of the columns in the grid 
 
We can disable filtering for particular column using AllowFiltering property of GridColumn. Refer the below code example.  

<EjsGrid DataSource="@Orders" AllowFiltering="true" AllowPaging="true"> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn> 
        <GridColumn Field=@nameof(Order.OrderDate) AllowFiltering="false" HeaderText=" Order Date" Format="yMd" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"> 
        </GridColumn> 
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
    </GridColumns> 
</EjsGrid> 

Also refer our UG documentation for your reference 



Query: “Like there should be no filtration textbox showing for this column in the Grid. 

By default when we disable filtering for particular column, its filter bar (input box) will be disabled. You can achieve this requirement using these methods 1. By changing the FilterType or 2. Using FilterbarTemplate.  
 
  1. Using FilterBarTemplate.

You can define the empty FilterTemplate for that particular column, if you want to remove the default filter bar. Refer the below code example.  

<EjsGrid DataSource="@Orders" AllowFiltering="true" AllowPaging="true"> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn> 
        <GridColumn Field=@nameof(Order.OrderDate) AllowFiltering="false" HeaderText=" Order Date" Format="yMd" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"> 
            <FilterTemplate></FilterTemplate> 
        </GridColumn> 
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
    </GridColumns> 
</EjsGrid> 

Also refer our UG documentation for your reference 


  1. By Changing the Filter type as Excel / Menu.

Refer our UG documentation for your reference 



Please get back to us if you have further queries.  

Regards, 
Vignesh Natarajan. 


Junaid
Replied On November 28, 2019 11:58 AM UTC

Thanks. That helped!!

Regards
Junaid

Vignesh Natarajan [Syncfusion]
Replied On November 29, 2019 03:46 AM UTC

Hi Junaid,  

Thanks for the update.  

We are glad to hear that your query has been resolved by our solution. 

Please get back to us if you have further queries. 

Regards, 
Vignesh Natarajan.   



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon