Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 September 24th, 2004, 02:08 AM
Registered User
Join Date: Sep 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to sort the items in the datagrid

     I want to sort the items in the data grid based on selected column in the datagrid, the column is of type either integer, string, or date type. here one thing... ,the data grid items are not in the order of sorting while binding the frist time from the datasource.if is there any way to do this, please help me.
Advanced thank you.
Old September 24th, 2004, 02:29 AM
Friend of Wrox
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76

You can write code in the "SortCommand" event of the datagrid to sort according to your requirement.

private void DataGrid1_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEvent Args e)


Similar Threads
Thread Thread Starter Forum Replies Last Post
sort items in the report manager aranjan BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 28th, 2007 03:35 PM
how to sort datagrid columns sumith ASP.NET 1.0 and 1.1 Professional 3 February 19th, 2007 01:12 AM
DataGrid Sort ChrisP VB.NET 2002/2003 Basics 0 January 15th, 2006 12:47 PM
Sort Datagrid Sheikha ASP.NET 1.x and 2.0 Application Design 1 June 29th, 2005 04:46 AM
Sort and Update the DataGrid omahataz BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 8 October 9th, 2004 07:19 AM

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