asp.net中的datagrid,gridview,datalist和repeator控件有什么区别? [英] what is the difference between datagrid,gridview,datalist and repeator control in asp.net?

查看:101
本文介绍了asp.net中的datagrid,gridview,datalist和repeator控件有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

asp.net中的datagrid,gridview,datalist和repeator控件有什么区别?

what is the difference between datagrid,gridview,datalist and repeator control in asp.net?

推荐答案

从下面的链接复制/粘贴:

repeater-listview-datalist-datagrid-gridview [ ^ ]



DataGrid,GridView和DataList控件派生自WebControl类,而Repeater控件派生自Control类。 WebControl类包含许多属性,例如BackColor,ForeColor,CssClass,BorderStyle等。在ASP .NET中,基本上有四种数据表示控件。



GridView(更多选项)DataGrid DataList Repeater(更少选项)Repeater Control的不同功能列表,Datalist Control和GridView Control功能。



GridView和DataGrid的功能:

将数据显示为table可更新项目作为行控制备用项目页眉页脚颜色,字体,边框等



Gridview - 设计有限,有效像一个HTML表。更多内置功能,如编辑/更新,页面,排序。很多开销。

DataGrid - Gridview的旧版本。 gridview是一个超级数据网格。

Datalist - 更多可定制的Gridview版本。也有一些开销。更多的手动工作,因为你必须自己设计。

ListView - 新的Datalist。几乎是datalist和gridview的混合体,您可以在其中使用分页和构建Gridview功能,但具有设计自由度。这个系列中的一个新控件

中继器 - 重量非常轻。没有内置功能,如页眉,页脚。开销最小。
Copy/pasted from below link:
repeater-listview-datalist-datagrid-gridview[^]

DataGrid, GridView and DataList controls are derived from the WebControl class, while the Repeater control is derived from the Control class. The WebControl class contains a number of properties, such as BackColor, ForeColor, CssClass, BorderStyle and so on. In ASP .NET basically there are four kinds of the Data Presentation Controls.

GridView (more options) DataGrid DataList Repeater (less options) List of different abilities of Repeater Control, Datalist Control and GridView Control features.

Features of a GridView and DataGrid:
Displays data as a table Updateable Item as row Control over Alternate item Header Footer Colors, font, borders, etc.

Gridview - Limited in design, works like an html table. More in built functionality like edit/update, page, sort. Lots of overhead.
DataGrid - Old version of the Gridview. A gridview is a super datagrid.
Datalist - more customisable version of the Gridview. Also has some overhead. More manual work as you have to design it yourself.
ListView - the new Datalist. Almost a hybrid of the datalist and gridview where you can use paging and build in Gridview like functionality, but have the freedom of design. One of the new controls in this family
Repeater - Very light weight. No built in functionality like Headers, Footers. Has the least overhead.


这篇关于asp.net中的datagrid,gridview,datalist和repeator控件有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆