完成设置后,Visual Studio 会自动为相关数据域
( data fields ) 创 建 BoundColumns 及 一 个
CheckBoxColumn。就像我们在前面的教程做的那样,将除了
ProductName, CategoryName 和 UnitPrice 外 的 其 它
BoundFields 删 除 , 并 将 相 关 HeaderText 属 性 设 置 为
“Product”, “Category” 和 “Price”。 将 UnitPrice
BoundField 格式化为货币形式。在智能标签里选择“Enable
Paging”启用 GridView 的分页功能。
为 了 在 用 户 界 面 里 可 以 删 除 选 中 的 产 品 , 在
GridView 下 面 添 加 一 个 Button Web 控 件 , 设 其 ID 为
DeleteSelectedProducts,Text 属性为“Delete Selected
Products”。在本例中我们不会直接从数据库删除数据,而
是显示一条消息,说明要删除的是什么产品。因此,在按钮