C sqldatasource updating
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.
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.
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.
Best of all, this functionality is wrapped up in a custom server control, so you can utilize this behavior without having to write any code in your ASP. Be sure to download the source code and the demo application available at the end of this article. After you've finished this article, read Improving the Sort Arrows Grid View Control, which discusses the enhancements in more detail.
This article's text has not been updated to reflect these changes.
The simplest option would be to require the page developer to specify the URLs for these two images. But I also wanted to allow the page developer to have a working Grid View even if she didn't want to spend the time to find up and down arrow images.
Therefore, I embedded an up and down arrow image into the properties.
In the previous article we talked about using the Sql Data Source control programmatically to obtain a result set from the database using a Data Reader object and a Data View object.
We used an Html Table control to create a visual representation to hold the returned result set.