列表视图和WPF中的DataGrid之间的区别? [英] Difference between List View and DataGrid in WPF?
问题描述
我必须从数据库中检索一些问题,并在用户屏幕上动态显示它们。我还需要在网格视图的列中添加一些控件,基本上是一个问题和输入框,以供答案。请建议哪一个我应该用吗列表视图或数据网格?
Hey I have to retrieve some questions from the database and display them on the user screen dynamically.I also need to add some controls in the columns of grid view,basically a question and input box for an answer.Please suggest which one should I use? List View or data Grid?
推荐答案
嗯,在WPF中, ListView
和 DataGrid
只是一个。编辑。您需要使用 DataGrid
编辑,否则使用 ListView
。您可以在 ListView
中进行编辑,但它更容易,并在 DataGrid
中构建。否则,可以在 ListView
中显示 DataGrid
中显示的任何内容。
Well, in WPF the difference between ListView
and DataGrid
is just one. Editing. You need editing use DataGrid
, otherwise use ListView
. You can edit in ListView
also but it is easier and build in DataGrid
. Otherwise, whatever can be displayed in DataGrid
, can be displayed in ListView
.
DataGrid
支持和 ListView
不是(开箱即用)的一件事是自动的列生成。
One thing which DataGrid
supports and ListView
doesn't (out of the box) is automatic column generation.
您可以阅读这篇关于CodeProject的文章,以便更好地了解 DataGrid
,还有关于 ListView
和 DataGrid
。
You can read this article on CodeProject for a better understanding of DataGrid
and also about the major differences between ListView
and DataGrid
.
这篇关于列表视图和WPF中的DataGrid之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!