Enabling Item Selection Using the DataGrid and DataList

The final feature I want to discuss is how to enable item selection. When you enable item selection, users can click on a button or LinkButton to select a row out of the DataGrid or DataList. For example, the user could highlight a particular row in the control for easy reading. Listing 10.6 illustrates how to implement Item Selection using the DataGrid.

Listing 10.6. Enabling Item Selection Using the DataGrid
 [Visual Basic] 01: <%@ import namespace="System.Data" %> 02: <%@ import namespace="System.Data.SqlClient" %> 03: <script language="vb" runat="server"> 04: private sSqlCon as string = "server=localhost;uid=sa;pwd=;database=northwind" 05: 06: public sub Page_Load(sender as Object, e ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.