Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
248 views
Welcome To Ask or Share your Answers For Others

1 Answer

GridView supports:

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

ListView supports:

  • List item
  • paging (need to use DataPager)
  • editing
  • selection
  • sorting by click (need to create an event handler manually)
  • template-based layout (rendered as you want it + provides more templates, e.g. - GroupTemplate)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...