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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding Displayed Rows when filtering

Thread ID:

Created:

Updated:

Platform:

Replies:

125688 Sep 2,2016 04:31 PM UTC Sep 6,2016 04:23 AM UTC WPF 3
loading
Tags: SfDataGrid
David García
Asked On September 2, 2016 04:31 PM UTC

Hi,

Is there a way to get or bind the displayed items when the grid is filtered (using the built-in filter feature)?

I want to be able to print the grid with only the displayed items and not the whole source collection but also don't want to use the built-in print.

Thanks in advance.

Gobikrishnan Murugesan [Syncfusion]
Replied On September 5, 2016 05:20 AM UTC

Hi David, 
 
Thank you for contact Syncfusion support. 
 
Query 1: 
 You can get the datagrid view items by using View.Records. Please find the code snippet below, 
//To get view records 
var viewRecords = this.dataGrid.View.Records; 
 
Query 2: 
 
Bydefault our SfDataGrid Print Manager prints records which is in view only. You can get the Print document using below the code snippet, 
 
var printDocument = this.dataGrid.GetPrintDocument(); 
var printDialog = new PrintDialog(); 
if ((bool)printDialog.ShowDialog()) 
    printDialog.PrintDocument(printDocument.DocumentPaginator, "Printing"); 
 
 
Sample: 
 
Please let us know if you have any query. 
 
Regards, 
Gobikrishnan 


David García
Replied On September 5, 2016 10:30 AM UTC

Thanks so much for the reply.

Very helpfull for my purposes.

Jai Ganesh S [Syncfusion]
Replied On September 6, 2016 04:23 AM UTC

Hi David, 
 
Thank you for the update. 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Jai Ganesh S 


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.

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

;