Adding Features to the DataGrid Control

In this chapter, you'll place a DataGrid control on a page and add features. Specifically, you will perform the following tasks:

  • Bind a DataGrid control to an ADO.NET DataSet

  • Add numeric formatting to a currency field

  • Add paging so users can move through subsets of the data

  • Select an individual row

  • Sort the data by clicking a column header

Figure 16.1 shows the finished page you'll be building as you work through this chapter.

Figure 16.1. It's easy to create a bound table using the DataGrid control. To the browser, it's simply an HTML table with code added in for interactivity.


You will need to add a hyperlink to the main page to call the new page you build in this chapter. Follow these steps to add the link:

1.
Open Main.aspx in design mode.

2.
Add a new HyperLink control just below the Employees hyperlink.

3.
Set the properties for this new HyperLink control as shown in Table 16.1.

Table 16.1. Set the New HyperLink Control's Properties Using These Values
Property Value
ID hypCatSales
Text Sales by Category
NavigateURL CategorySales.aspx

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.180.43