gpt4 book ai didi

.net - ListView 与数据网格

转载 作者:行者123 更新时间:2023-12-03 23:25:21 25 4
gpt4 key购买 nike

与使用 ListView 相比,使用数据网格控件的主要优势是什么?什么时候应该使用每一个?

最佳答案

需要考虑的几点 Colin Eber已在 DataGrid vs GridView 中声明讨论:

  • ListView (GridView) is a readonly control out-of-the-box.The standard solution would be to synchronise the list with a 'details view' comprised of textBoxes
  • The DataGrid allows in-place editing of data
  • The DataGrid performs transaction edits (the row is treated as an atom)
  • The DataGrid support auto-column generation
  • The DataGrid has a RowDetails element (if you like that sort of thing!)
  • The DatGrid supports pretty much everything the ListView does, multiple selection modes, styling, etc ...


还有一个重要的:
  • 通过单击列标题,DataGrid 具有内置的排序支持。虽然添加排序到 ListView/GridView 是 absolutely possible ,我宁愿在 DataGrid 中提供开箱即用的这类东西。
  • 关于.net - ListView 与数据网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3174428/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com