What is the difference between Data Grid and Data Repeater control?

Repeator Control:
·
1)Read-only; no inherent support for selection or editing ·
2)No inherent look; you lay out the list by creating templates.
3)List can be vertical, horizontal, all on one line, or in any format you specify. ·
4)No default paging; all data is displayed in a single list. ·
5)Separators between elements can be defined using a template

Datagrid:

1)Default look is a grid (customizable table) ·
2)Can customize look of table extensively. ·
3)Options for auto-formatting. ·
4)Can specify output using bound columns, columns of buttons or hyperlinks, and custom
columns created using templates. ·
5)No separator template. However, the grid renders in a table, and you can specify table border size and color. ·
6)WYSIWYG template editing ·
7)Items support styles for custom look. ·
8)Editable contents, including deletion ·
9)Single and multiple selection ·
10)Optional paged output ·Support for sorting ·
11)Support for custom functionality that can be applied to items

.......................................................................................................
1) Repeater
2) DataList
3) DataGrid

A repeater has the best performance as it's lighter. DataLists and DataGrids have inbuilt methods which makes them heavier in load, but also very effective if you need to display data in a number of ways (ie sorting, indexing, records per page etc...) whereas with a Repeater you'd have to implement these yourself.

If you simply want to output some data on a page I'd recommend a Repeater. If however you'll be manipulating this data in any way, such as sorting etc... then use a DataList or DataGrid. The choice should depend upon the data you have and what you want to do with it.

Also as mentioned above it's much easier to implement custom html into a Repeater. You can still however do this with a DataGrid or DataList it's just a little more tricky.
............................................................................................................................

Datagrid is
* one which has advanced features and lets you do lot many things like <b>paging and sorting </b>your data without much effort.
* DataGrid can hold text data, but not linked or embedded objects.


Whereas a DataRepeater is
* which does not have the paging feature but we can do it by coding.
* one which can hold other controls and can embed objects.
* It can embed a Datagrid within it but not viceversa.

Apart from this a Data Repeater
--is used in places where you need more control over the rendering of your data
-- have very flexible templates that give you total control over the formatting of your data

0 comments:

Post a Comment