What is the difference between WPF's ListBox and ListView? I can not find any significant difference in their properties. Is there different typical use?
相关问题
- Generic Generics in Managed C++
- VNC control for WPF application
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
相关文章
- .net中MessageBox.Show使用问题
- IdentityServer 报错:"idp claim is missing"
- 在 IdentityServer 中如何给 id token 添加更多信息
- WPF:如何在Trigger里修改Orientation?
- IdentityServer 的 Selector 在哪个 nuget 包
- 使用 IdentityServer 的项目遭遇错误:"IDX20803: Unable to obt
- ASP.NET Core ConfigureServices 中从 appsettings.json
- WPF aforge 怎么做一个 圆形的播放器
A
ListView
let you define a set ofviews
for it and gives you a native way (WPF
binding
support) to control the display ofListView
by using definedviews
.Example:
XAML
Code Behind:
OUTPUT:
Normal View: View 2 in above
XAML
MouseOver View: View 1 in above
XAML
A
ListView
is basically like aListBox
(and inherits from it), but it also has aView
property. This property allows you to specify a predefined way of displaying the items. The only predefined view in the BCL (Base Class Library) isGridView
, but you can easily create your own.Another difference is the default selection mode: it's
Single
for aListBox
, butExtended
for aListView
Listview derives from listbox control. One most important difference is listview uses the extended selection mode by default . listview also adds a property called view which enables you to customize the view in a richer way than a custom itemspanel. One real life example of listview with gridview is file explorer's details view. Listview with grid view is a less powerful data grid. After the introduction of datagrid control listview lost its importance.