get filter values datagrid

hi ,

I filtered sfdatagrid for example ;

orderid=100,productname='product'

how can i get filter values like " orderid='100',productname='product' "

thanks for help




3 Replies

MA Mohanram Anbukkarasu Syncfusion Team March 4, 2022 02:33 PM UTC

Hi Serder, 

We are little unclear whether your requirement is to get the records in UI after filtering or the values based on which the filter is applied.  

Case 1 : Get the records in UI after filtering 
 
You can get the records in the UI after filters applied by using SfDataGrid.View.Records collection as shown below.  

Code example :  

foreach(var item in this.sfDataGrid1.View.Records) 
{ 
    var record = item.Data; 
} 

Case 2 : Get the values based on which the filter is applied.  

You can get the values based on which the filter is applied for a specific column by using GridColumn.FilterPredicates collection as shown below.  

Code example :  

var columnFilterPredicates = this.sfDataGrid1.Columns["OrderID"].FilterPredicates; 
foreach (var filterPredicate in columnFilterPredicates) 
{ 
    var filterValue = filterPredicate.FilterValue; 
    var filterCondition = filterPredicate.FilterType; 
} 


Please revert to us with more details about your requirement with clear illustrations if we have misunderstood your requirement.  

Regards, 
Mohanram A. 



SE Serdar March 7, 2022 06:13 PM UTC

hi  Mohanram ,

ok , i understand , i will apply

thanks for reply



SS Sampathnarayanan Sankaralingam Syncfusion Team March 8, 2022 03:08 PM UTC

Hi Serder, 


Please let us know if you need any further assistance.


Regards,

Sampath Narayanan.S


Loader.
Up arrow icon