| 1. |
How To Sort The Contents Of A Gridview Control? |
|
Answer» 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. 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. |
|