Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
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 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 30th, 2008, 06:53 PM
Friend of Wrox
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default [Resolved] GridView - manually set SortExpression

I need to manually set the sort expression for a GridView. I need to retrieve the boundfield name for column = 0

Session("SortExpression") = GridView1.????? (name of the boundfield)

The name of the boundfiled is "CompanyJobID" and if I do this
Session("SortExpression") = "CompanyJobID" it works fine.
Old November 3rd, 2008, 10:00 AM
Friend of Wrox
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts

Got it working:

Dim myDataControlField As DataControlField = GridView1.Columns(0)
Dim mySortExpression As String = myDataControlField.SortExpression

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] GridView to Excel snufse ASP.NET 2.0 Basics 2 October 28th, 2008 02:37 PM
[Resolved] GridView TemplateField - get value snufse ASP.NET 2.0 Basics 25 July 29th, 2008 07:25 AM
[Resolved] IListSource problem in GridView snufse ASP.NET 2.0 Basics 5 February 12th, 2008 01:42 PM
Enable Editing on Gridview - RESOLVED Andrew.Berry ASP.NET 2.0 Basics 0 October 3rd, 2007 05:29 AM
Sorting GridView manually pettrer ASP.NET 2.0 Basics 3 June 5th, 2006 10:51 AM

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