How to get filtered/sorted data from DataGrid

T

Tim

Hi

I am implementing some printing in C# and I need to get the data for it. I
am using a datagrid. I can sort the data and filter it. I want to get a
datatable of only the data visible in the datagrid. The underlying dataview
holds all the records. If I have a dataview with 80 records in but the user
does a filter in the datagrid, I want to get only the 5 filtered records.

Can anyone help me with this one?

Tim
 
P

Pete Davis

If you're using the DataView for the filtering and sorting, why don't you
use the DataView to get the records for printing? It will have the
sorted/filtered data.

Just use DataView[rowIndex] to get the DataRowView for a row.

I assume you're using the DataView.RowFilter and DataView.Sort....

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top