如何与在WPF文本编辑列表视图? [英] How to have a listview with textbox editable in WPF?

查看:119
本文介绍了如何与在WPF文本编辑列表视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然我张贴这一点。我想,我可以使用一个数据网格。

While I'm posting this. I thought, I can use a datagrid.

是如此复杂创建一个列表视图编辑或者是更好地使用DataGrid?

Is so complex to create a listview editable or is better to use the datagrid?

推荐答案

这并不难,只需添加的 GridViewColumn 以<一个href=\"http://msdn.microsoft.com/en-us/library/system.windows.controls.gridviewcolumn.celltemplate.aspx\"相对=nofollow> CellTemplate 包含文本框

It's not that hard, just add a GridViewColumn with a CellTemplate that contains a TextBox.

DataGridTextColumns 有点更简单但正如你只需要指定绑定,而文本框自动创建。你可以创建一个 GridView的自定义类( GridViewTextColumn ),它做同样的事情,但。

The DataGridTextColumns are a bit more simple though as you just need to specify the Binding while the TextBox is created automatically. You could create a custom class for GridViews (GridViewTextColumn) which does the same thing though.

这篇关于如何与在WPF文本编辑列表视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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