All other fields - the Template Field, Check Box Field, Button Field, and so on - will correctly display the up and down arrow images without any extra hacks.
We'll see how to use this custom Bound Field class in the "Using the Custom Grid View Control in an ASP. At this point you may be wondering how the custom Grid View control determines the URLs for the up and down image arrows.
In this article we will look at the steps for building such a custom control as well as how to use the control in an ASP. The custom control's complete source code and a demo application are available for download at the end of this article. If you have programmatically bound data to the Grid View, then you will need to create an event handler for the property is toggled.
This functionality enables the Grid View control to provide built-in, bi-directional sorting.
When I implemented the up and down arrow images for the Data Grid control in Part 18 of the An Extensive Examination of the Data Grid Web Control article series, I put the code that added (or removed) the arrow images in the ASP. Specifically, the code enumerated the Data Grid's properties.
Therefore, I embedded an up and down arrow image into the properties.
After you've finished this article, read Improving the Sort Arrows Grid View Control, which discusses the enhancements in more detail. NET version 2.0 was released, I wrote a book and dozens of articles on the Data Grid control, which was the most functional data Web control in the ASP. The Grid View can be bound to data source controls like the Sql Data Source and Object Data Source, and paging, sorting, editing, and deleting can be implemented without having to write a single line of code.
While the Data Grid (and Grid View) offer built-in sorting support, there is no visual feedback as to what column the data is sorted by.
NET page very similar to that used for the Data Grid.
However, I decided that instead of having to write code for each page where I wanted to show up and down arrow images, I decided to instead build a custom server control that extended the Grid View control.