WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 178 users


Using ASP.NET 3.5's ListView and DataPager Controls: Sorting Data with the ListView Control

Blogger : 4GuysFromRolla.com Headlines
All posts : All posts by 4GuysFromRolla.com Headlines
Category : ASP.NET
Blogged date : 2008 Jan 16

When binding data to a GridView using a data source control, enabling sorting is as simple as ticking the "Enable Sorting" checkbox in the GridView's Smart Tag. Enabling sorting turns each GridView column's header into a LinkButton that, when clicked, causes a postback and re-binds the data to the GridView, sorting it by the clicked column.

Likewise, enabling sorting in the ListView is a fairly simple and straightforward process and can be accomplished without writing a line of code. The main challenge with enabling sorting in the ListView control is that there are no pre-defined columns, like with the GridView. Therefore, we are on the hook for defining and implementing the sorting interface. But once this is setup, the ListView can internally handle the sorting logic without the need for us to write any additional code. Of course, in more advanced scenarios we may need to manually sort the data or programmatically specify the sort expression used to internally sort the data. Prior to sorting, the ListView raises its Sorting event handler, which is an ideal place to add any additional sort-related logic. Moreover, the ListView control's sorting logic can be programmatically invoked via its Sort method.

In this article we will look at how to enabling sorting in the ListView control. We will look at using the ListView's simple, baked in sorting functionality. Following that, we will see how to programmatically invoke this sorting logic via the Sort method as well as more advanced scenarios. Read on to learn more!
Read More >


Read comments or post a reply to : Using ASP.NET 3.5's ListView and DataPager Controls: Sorting Data with the ListView Control
Page 785 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card