2016-01-05 41 views

回答

0

顯然你是從一個WinForms背景的,其中編輯ListViewItem的標籤是內置的。

WPF沒有這個內置的功能,所以你必須自己實現它。

標準GridViewColumn標籤給出了一個不可編輯的列。 既然你想編輯這個字段,你應該在CellTemplate中使用一個TextBox

例子:

<GridViewColumn.CellTemplate> 
    <DataTemplate> 
     <TextBox Width="40" Text="{Binding FieldName}"/> 
    </DataTemplate> 
</GridViewColumn.CellTemplate>