Only "View" specific rows in DataView

  • Thread starter Thread starter Raterus
  • Start date Start date
R

Raterus

Howdy,

Here is what I have, I'm working on a search engine, where the results can be sorted, and paged through. (This is for a Web app btw)

My results of the search from the database are stored in a DataTable.

From this DataTable I create a DataView, that sorts the datatable.

Now I need to bind certain rows of this view to the DataSource, and here is where I'm running into problems.

Say I'm on page 4 of my results, and at 10 results per page, I need to bind rows 31-40 of this dataview to my control (a asp.net repeater). Is there some way I can filter this DataView based on the index of the items, not anything specific to the data itself. Or perhaps there is a way to copy these rows to another view (Didn't look possible) I know I can create another datatable and add rows manually from the view, but that just seems like too much overhead when I'm so close.

Any Ideas?
--Michael
 
Take a look at the PagedDataSource class.

Howdy,

Here is what I have, I'm working on a search engine, where the results can
be sorted, and paged through. (This is for a Web app btw)

My results of the search from the database are stored in a DataTable.

From this DataTable I create a DataView, that sorts the datatable.

Now I need to bind certain rows of this view to the DataSource, and here is
where I'm running into problems.

Say I'm on page 4 of my results, and at 10 results per page, I need to bind
rows 31-40 of this dataview to my control (a asp.net repeater). Is there
some way I can filter this DataView based on the index of the items, not
anything specific to the data itself. Or perhaps there is a way to copy
these rows to another view (Didn't look possible) I know I can create
another datatable and add rows manually from the view, but that just seems
like too much overhead when I'm so close.

Any Ideas?
--Michael
 
You mean I could have been using the datagrid's paging interface this whole time! Gah! I had never heard of this class until now, and it is certainly going to make my my life much easier! Thanks!
--Michael
 
Back
Top