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.This arrow provides the user with visual feedback as to what column the data is sorted by, as well as whether the data is sorted in ascending or descending order. I encourage you to still read this article to get an overview of the rationale behind the custom Grid View control and to understand the initial architecture.
Consequently, the grid displays the standard up and down arrow images (see the first screen shot below).
If you want to use custom arrow images, specify the URL either declaratively or programmatically. The demo page includes a checkbox that allows you to toggle between using the default arrow images and custom ones.
The built-in up and down arrow images are used here.
In this article we looked at building a custom Grid View server control (along with a custom Bound Field control) in order to automatically display up and down arrow images for the sorted column. This article's text has not been updated to reflect these changes.
The following diagram depicts the sorting workflow, including the Grid View's assignment of its properties.