WPF中ListView和DataGrid之间的区别? [英] Difference between ListView and DataGrid in WPF?

查看:929
本文介绍了WPF中ListView和DataGrid之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从数据库中检索一些问题并将其动态显示在用户屏幕上.我还需要在网格视图的列中添加一些控件,基本上是一个问题和一个答案输入框.

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.

请建议我使用哪一个? ListViewDataGrid?

Please suggest which one should I use? ListView or DataGrid?

推荐答案

好,在WPF中,ListViewDataGrid之间的区别只是一个.编辑中.您需要使用DataGrid进行编辑,否则请使用ListView.您也可以在ListView中进行编辑,但是更容易在DataGrid中进行构建.否则,可以在ListView中显示的任何内容都可以在ListView中显示.

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的这篇文章,以更好地理解以及ListViewDataGrid之间的主要区别.

You can read this article on CodeProject for a better understanding of DataGrid and also about the major differences between ListView and DataGrid.

这篇关于WPF中ListView和DataGrid之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆