08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 4 ■ DATA BINDING WITH <strong>ASP</strong>.<strong>NET</strong> 99<br />

Sorting: This makes the columns clickable, enabling the data to be sorted based on<br />

clicking the column.<br />

Selection: This adds a Select hyperlink, enabling an event to be fired when the user<br />

selects a row of data.<br />

You can see an example of the postal code filter application using a GridView control<br />

in Figure 4-28.<br />

Figure 4-28. Your application including paging, sorting, <strong>and</strong> selection<br />

You have all this functionality, <strong>and</strong> you still haven’t written a line of code, thanks to<br />

the GridView control <strong>and</strong> ADO.<strong>NET</strong> data binding!<br />

Using the DataList Control<br />

The GridView is a large control with a wealth of functionality, <strong>and</strong> in the previous section,<br />

you barely scratched the surface of what you can do with it. If you just want to return a<br />

list of data <strong>and</strong> codelessly control how that list appears, you can achieve this with the<br />

DataList control. This control is a server control, found on the Data tab of your Toolbox.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!