Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 3rd, 2006, 09:42 AM
Authorized User
 
Join Date: Jul 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data View Sorting Question

Hello and thanks for taking a moment to read this message. I am using a DataView to sort on the columns of a datagrid.(Doing this from within the SQL turned out to be more trouble than it was worth in this particular case.) The problem is that my DataGrid also allows paging.

 I am trying to figure out how to sort data on a page by page basis.( example, if I'm on page 3 of my data grid, I want to click on a grid column and see only they sorted data which was on page 3) Currently, when I click a column heading, it shows me the data at the very top of the result set. (again, not what I want if I was on page 3) Itr should be noted that I am not doing custom paging in this case. Below is my snippet of Codebehind that runs when I click a column heading. Any help would be greatly appreciated.Thanks,

Jason

public void Grid_Sort( Object source,DataGridSortCommandEventArgs e)

{

//Get the entire result Set

ActionLinkSupport alxr = new ActionLinkSupport();

DataSet ds = alxr.GetInventoryDataForActionLink(Convert.ToInt32 (drpRetailer.SelectedValue),(drpDisplayName.Select edItem).ToString(),(drpDisplayPopItemDescription.S electedItem).ToString(),Convert.ToInt32(ddaction.S electedValue),e.SortExpression.ToString());

//Use a Data View to be able to sort on the columns will sort on e.SortExpression

DataGrid2.DataSource = new DataView(ds.Tables["tblInventoryItems"],string.Empty,e.SortExpression.ToString(),DataView RowState.CurrentRows);

DataGrid2.DataBind();

}







Similar Threads
Thread Thread Starter Forum Replies Last Post
A simple Sorting question bonekrusher XSLT 2 November 25th, 2007 09:40 AM
about grid view sorting rdinesh1975 ASP.NET 2.0 Professional 3 August 9th, 2007 05:27 AM
Sorting on similar tags question terrypink XSLT 21 April 2nd, 2007 02:55 PM
Subform data sheet view question amob005 Access 1 December 5th, 2006 09:13 AM
HELP! More complicate sorting nodes question kevin_in_black XSLT 2 April 13th, 2004 05:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.