Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 8th, 2006, 02:23 PM
Registered User
 
Join Date: Dec 2004
Location: calgary, ab, Canada.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sort with gridview

Hello,
I have been trying to get this to work now for 2 days and I must be missing something cause I don’t think it should be this hard. I have a gridview that I fill without using a datasourceid. All I want to do is be able to sort the columns however the user wants to. I have been able to find C code that helps but no examples with VB. I have got as far as being able to get to the sub gridView_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) but cant get past this point. Can anyone please give me a hint or send me to a good example on the web.
Thanks

Reply With Quote
  #2 (permalink)  
Old December 9th, 2006, 09:17 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi
there are lots of ways when u want to display the datacolumns in grid in sorted form
i want to know what actually u are using my mean to bind the datagrid with the columns of a table you are using templates or you are using <asp:boundcolumns>
if u are using bound column then it have its property SortExpression which we can use like
<asp:BoundColumn datafield="nameofcolumn" sortexpression="nameofcolumn which u want to use as sort expression"/>
if u will use above data will be displayed in sorted order.

secondly in a query which u are using to retrieve the data as select query apply order by clause at last. by this select query will generate the result in sorted order and grid will also after that

if u are using item templates then u can write a program i will write if u need



thanks......
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView - initial load and sort direction snufse ASP.NET 2.0 Basics 0 October 30th, 2008 08:20 PM
[2005] GridView sort problem snufse ASP.NET 2.0 Basics 7 February 12th, 2008 10:26 AM
GridView Sort (Top Urgent ) msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 02:34 AM
GridView sort without DataSet? drasko ASP.NET 2.0 Professional 1 October 3rd, 2006 06:57 AM
how to sort cross tab.sort based on row total joxa83 Crystal Reports 7 March 2nd, 2006 09:12 AM



All times are GMT -4. The time now is 09:26 AM.


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