0
爲什麼WPF DataGrid控件不示出了用於網格列定義DisplayNameAttribute值?但是,使用Winforms DataGridView時,這工作正常!WPF數據網格:問題與表示DisplayNameAttribute值
非常感謝;)
爲什麼WPF DataGrid控件不示出了用於網格列定義DisplayNameAttribute值?但是,使用Winforms DataGridView時,這工作正常!WPF數據網格:問題與表示DisplayNameAttribute值
非常感謝;)
它不會在WPF中以這種方式工作。你可以爭辯說它是關於保持視圖和模型數據的分離。
處理您的問題被簡單地定義領先列的時間,最簡單的方法;與將AutoGenerateColumns
設置爲true對比。
<toolkit:DataGridTextColumn Header="{x:Static const:Resources.ScriptNameHeader_String}" Binding="{Binding Name}"/>
我使用原生wpf DataGrid控件,所以我想我應該使用wpf工具箱的DataGrid控件。你用過嗎?支持這個? – Sadegh 2011-03-02 19:43:44
@Sadegh我在.NET 3.5 SP1,所以我使用WPF工具包DataGrid的應該是其移動到.NET 4.我的例子應該工作使用.NET 4的DataGrid AFAIK相同的DataGrid。 – 2011-03-02 19:48:09
在目前我正在使用.NET 4!我的問題是關於DisplayName,Browsable等的支持;而不是你的方法。謝謝Aaron – Sadegh 2011-03-02 20:00:15