如何制作简单的列表视图或行列表框可编辑为文本框

时间:2014-09-08 14:30:06

标签: c# wpf listview listbox contenteditable

我正在寻找一个简单的解决方案,允许我在

中编辑listbox或listview的内容

C#.net 4.5 WPF应用程序

我遇到了listView1.LabelEdit = true;但是在wpf中没有这样的选项

和datagrid并不像使用listbox或listview

那么容易

那么有什么简单的解决方案吗?

非常

示例列表框和列表视图

<ListView  Name="lstBoxTableColumnValues" HorizontalAlignment="Left" Height="462" Margin="315,76,0,0" VerticalAlignment="Top" Width="214"/>
<ListBox Name="lstBoxSelectedColumnDistcintValues" HorizontalAlignment="Left" Height="462" Margin="534,76,0,0" VerticalAlignment="Top" Width="282"/>

使用示例

lstBoxTableColumnValues.Items.add(string);
lstBoxSelectedColumnDistcintValues.Items.add(string);

string asdsa=lstBoxTableColumnValues.Items[0];
asdsa=lstBoxSelectedColumnDistcintValues.Items[0];

让我们说在填充Listbox后,我将点击我想要的任何索引项并编辑其内容。当我检索到该特定索引时,我将获得我编辑的值。

0 个答案:

没有答案