.NET中使用GridView显示数据(C#)

本文详细介绍了如何在.NET环境中利用GridView显示数据,包括基于SqlDataSource和ObjectDataSource的两种方法。从简单的GridView介绍开始,逐步演示了创建数据库、配置数据源、设置分页和排序等功能,同时提供了三层架构的示例代码。
摘要由CSDN通过智能技术生成

一、首先浏览一下msdn中的关于GridView的简单介绍:

 

The GridView view mode displays a list of data items by binding data fields to columns and by displaying a column header to identify the field. The default GridView style implements buttons as column headers. By using buttons for column headers, you can implement important user interaction capabilities; for example, users can click the column header to sort GridView data according to the contents of a specific column.

 

GridView view of ListView content

Styled ListView 

GridView columns are represented by GridViewColumn objects, which can automatically size to their content. Optionally, you can explicitly set a GridViewColumn to a specific width. You can resize columns by dragging the gripper between column headers. You can also dynamically add, remove, replace, and reorder columns because this functionality is built into GridView. However, GridView cannot directly update the data that it displays.

The following example shows how to define a GridView that displays employee data. In this example, ListView define

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值