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

Filter Data on the basis of dropdown in custom toolbar

Thread ID:

Created:

Updated:

Platform:

Replies:

146522 Aug 7,2019 05:50 AM UTC Aug 8,2019 09:36 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: DataGrid
Muhammad Tassadaque Zia
Asked On August 7, 2019 05:50 AM UTC

I have seen this post about how to add dropdown in custom toolbar. I want to know how can i filter grid data on the basis of value selected in dropdown

Dhivya Rajendran [Syncfusion]
Replied On August 8, 2019 09:36 AM UTC

Hi Muhammad, 

Thanks for contacting Syncfusion support. 

We have analyzed your requirement and we suggest you to bind change event for dropdown and get the selected value from dropdown list then based on the value you can perform filter in Grid by using filterByColumn method. 

Index.cshtml 
<ejs-dropdownlist id="filterDropDown" dataSource="@ViewBag.DataSource" placeholder="Select a Value to Filter" width="300" change="dropDownchange" popupHeight="220px"> 
    <e-dropdownlist-fields text="OrderID" value="OrderID"></e-dropdownlist-fields> 
</ejs-dropdownlist> 
 
<ejs-grid id="Grids" dataSource="ViewBag.DataSource" allowPaging="true" allowFiltering="true"> 
    . . . . . 
</ejs-grid> 
 
<script> 
    function dropDownchange(args) { 
        var grid = document.getElementById('Grids').ej2_instances[0]; 
        grid.filterByColumn('OrderID', 'equal', args.value); 
    } 
    
</script> 


Regards, 
R.Dhivya 


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