BoundColumns

In the previous examples, the DataGrid has been bound to a data source and the columns have been created dynamically based on the columns in the DataTable. BoundColumns can be used to create a custom column layout for the DataGrid. Each BoundColumn can define the column heading text and the field in the table to sort on. Like all controls in ASP.NET, BoundColumns includes basic properties such as Visible, among others. In Chapter 7, “Working with ASP.NET Server Controls Templates,” you'll learn about other properties of BoundColumns. This chapter covers only the basic properties.

BoundColumns are encapsulated inside a property declaration. The DataGrid property is named Columns. Each BoundColumn renders a table column populated with ...

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.