ASP.NET网格视图与列表视图 [英] ASP.NET Grid View vs. List View

查看:207
本文介绍了ASP.NET网格视图与列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用的ListView GridView控件上的优势是什么?我需要分页,编辑行,插入行,在我看来,删除行。这是控制最好的是什么?它看起来像GridView控件不支持数据寻呼机。我会怎么牺牲,如果我迁移我的GridView的列表视图来?

What are the advantages of using listview over gridview? I need pagination, editing rows, inserting rows, and deleting rows in my view. Which control is best for that? It seems like GridView does not support data pager. What would I sacrifice if I migrated my gridviews to listviews?

推荐答案

GridView的支持:

GridView supports:


  • 按点击排序

  • 分页

  • 编辑

  • 选择

  • 基于模板的布局(内呈现<表>

  • sorting by click
  • paging
  • editing
  • selection
  • template-based layout (rendered within <table>)

ListView的支持:

ListView supports:


  • 项目

  • 分页(需使用DataPager的)

  • 编辑

  • 选择

  • 按点击排序(需要手动创建一个事件处理程序)

  • 基于模板的布局(呈现为您希望它+提供了更多的模板,例如 - GroupTemplate)

使用的ListView如果你需要一些特殊的布局,例如,创建一个在同一行中放置一个以上的项目表,或从挣脱会的原因表为基础共渲染) - 这是不可能的GridView的

The reason to use ListView would be if you need some special layout, for example, to create a table that places more than one item in the same row, or to break free from table-based rendering altogether) - which is not possible with GridView.

,另一方面使用GridView控件 更容易和更快,所以除非你需要特殊的布局,以显示您的数据,使用GridView的。

Using GridView on the other hand is easier and faster, so unless you need special layout to display your data, use GridView.

这篇关于ASP.NET网格视图与列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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