Adding Features to the DataGrid Control

IOTA^_^    

ASP.NET Developer's JumpStart
By Paul D. Sheriff, Ken Getz
Table of Contents
Chapter 16.  Using 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.

graphics/16fig01.jpg

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


    IOTA^_^    
    Top


    ASP. NET Developer's JumpStart
    ASP.NET Developers JumpStart
    ISBN: 0672323575
    EAN: 2147483647
    Year: 2002
    Pages: 234

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net