当使用一个gridview以及何时使用上表中的行中继器显示表格数据? [英] When to use a gridview and when to use a repeater on table rows to show tabular data?

查看:139
本文介绍了当使用一个gridview以及何时使用上表中的行中继器显示表格数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们从数据库中获取表格数据,并希望显示在UI上,如产品,产品列表或注册用户为网站管理员列表搜索结果。

When we get tabular data from the database and want to show on the UI, such as search result for products, products list or list of registered users for site administrators.

著名的控制要做到这一点是网格视图,而我preFER用一个简单的中继器和一个表行此中继环,这时候我就需要这个表格数据绑定到大量的OS客户端脚本。

The famous control to do that is the grid view, while i prefer to use a simple repeater and this repeater loop on a table row, that's when i will need to bind this tabular data to a lot os client side scripts.

这是使用中继器在网格的原因之一。

This is one of the reasons to use repeater over a grid.

和有时它能够更好地使用网格视图。

And sometimes its better to use a grid view.

我只是想让你陪我你什么时候要使用的时候不要用,我知道有没有为一个标准的想法分享,但我只是想听到的想法,我会判断根据我目前的案例。

I just want you to share with me your ideas about when to use which and when not to use, i know there is no a standard for that, but i just wanted to hear ideas, and i will judge based on my current case.

推荐答案

中继器没有内置在排序,缓存,分页或编辑的支持。虽然他们提供更大的灵活性,当谈到定制由控件生成的标记。

Repeaters do not have built in support for sorting, caching, paging or editing. Although they do provide more flexibility when it comes to customizing the markup generated by the control.

下面是一些详细信息的链接,这些信息的是年纪大一点的,并概述中继和数据网格之间的差异,但仍然是有用的不过。

Here are some links to more information, the information is about is a little older and outlines the differences between repeaters and data grids but is still useful nonetheless.

这篇关于当使用一个gridview以及何时使用上表中的行中继器显示表格数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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