Analysis of the differences between datalist Repeater and Gridview

  • 2020-05-30 19:46:58
  • OfStack

griview advantages: the most powerful function, provides paging, editing, deletion, selection and many other functions, the most convenient to use, directly drag and drop to the page, establish a new data source, a few clicks of the mouse can maintain a table of browsing, deletion and modification, and is paging oh. (I haven't figured out how to do this with a few mouse clicks, so let me know if you know.) . And because the templates have been customized, it is not easy to control them flexibly.

Disadvantages: it takes up a lot of system resources, and its paging is to take out the data of the entire table and page it on gridview, so if the data volume is large, the speed is very, very slow. Extremely inefficient.

datalist has better style control. No built-in paging. Editors and so on. You have to write it yourself.

There is also a repeater

Advantages: simple function, high efficiency, easy to flexibly control the generated HTML code, pagination needs to be realized by yourself, on the whole, if you use habit repeater, you will like it, suitable for the front desk.

datalist is between them

When to use depends on your own program.

Person 2:

Simply put: GridView, DataList are all derived from WebControl, have WebControl style attribute, and will be parsed to table, where each line will be parsed to tr-td,

Repeater is derived from Control, it just repeats the content in the template, which is why repeater does not provide templates and style control such as ItemStyle and SelectItemTemplate

In terms of flexibility, Repeater is definitely more flexible. It just loops content instead of generating the 1 series garbage code specified, but it also loses some of the functionality provided However, the compiled html is simpler and therefore relatively efficient

Speaking from the use, it depends on which you are better at using, Repeater is easier to set the style, GridView is easier to do such operations as adding, deleting and changing.

Related articles: