Wrox Programmer Forums
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 June 29th, 2005, 04:28 AM
Authorized User
Join Date: Sep 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sort Datagrid


im building a vb.net web based application. i have a datagrid that holds 2 columns. one is a templete column and the other is a bound column. the template column when clicked takes you to a differenet page. im trying to sort these 2 columns, but currently i can only sort on the template column. the bound column doesnt get sorted. below is the code that i wrote for it:

Dim dvContractor As New DataView(objFailure.loadWellWithoutCode(adoCnData) .Tables(0))
Dim intloop As Integer
For intloop = 0 To dgWithoutCode.Columns.Count - 1
If dgWithoutCode.Columns(intloop).SortExpression = e.SortExpression Then
If dgWithoutCode.Columns(intloop).FooterText = "" Or dgWithoutCode.Columns(intloop).FooterText = " DESC" Then
dgWithoutCode.Columns(intloop).FooterText = " ASC"
dgWithoutCode.Columns(intloop).FooterText = " DESC"
End If
Exit For
End If
dvContractor.Sort = e.SortExpression & dgWithoutCode.Columns(intloop).FooterText
dgWithoutCode.DataSource = dvContractor

kindly advise.


Old June 29th, 2005, 04:46 AM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

What type of data is in the source column that is tied to the template column? Is it logically sortable?


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to sort datagrid columns sumith ASP.NET 1.0 and 1.1 Professional 3 February 19th, 2007 01:12 AM
datagrid does SORT integer data properly chayanvinayak Flash (all versions) 3 July 27th, 2006 02:59 PM
DataGrid Sort ChrisP VB.NET 2002/2003 Basics 0 January 15th, 2006 12:47 PM
Sort and Update the DataGrid omahataz BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 8 October 9th, 2004 07:19 AM
how to sort the items in the datagrid Ramakrishna.G General .NET 1 September 24th, 2004 02:29 AM

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