.NET FAQs Unleashed!
Skip Navigation Links
Interview questions on Design Patterns in .NET
ASP.NET Ajax Interview Questions
Interview questions related to security
C# Interview Questions
ASP.NET Interview Questions
Interview Questions in ASP.NET 2.0
Articles at dotnetuncle.com
Skip Navigation Links
OOPs questions in .NET
Questions on .NET Framework
ADO.NET Interview Questions
Short Answer questions in .NET
Frequently asked differences in .NET
Important commonly used Acronyms in .NET
MS SQL, Oracle SQL Interview Questions
 
    
Dotnetuncle's Tip:

  Mono is a project that has compiler that can run on Mac OS X, Linux, Windows and Solaris

    

How to sort the contents of a GridView control?

The ASP.NET 2.0 GridView control is a powerful control, the enables sorting of the rows based on a column, all this possible, without writing code. Well thats what we call power!

The GridView control relies on the underlying data source control to whom this is bound for the sorting capability. The GridView needs to have an AccessDataSource or an SQlDataSource or an ObjectDataSource (if the SortParameterName property is set to a value allowed.

The AllowSorting property of the GridView control, when set to true, enables sorting of the GridView. A sortable GridView has the Header column represented as a LinkButton control. When this Link Button is clicked, the Sorting event of the GridView is raised server-side, which causes a postback and in turn, sorts the GridView control's records.

Bind data to a server control without writing code   Masterpage ContentPage   Nested Masterpage?   SiteMapPath control   Sort GridView   Hotspot class, ImageMap   Update Delete Gridview, Datakeynames  


    
Dotnetuncle's Tip:

  There are two key ways to find the data type of a variable. 1) GetType method. For ex: int I = 2; Then i.GetType().Name will display int. 2) use the typeof operator. Ex: typeof(i) will return int.