【问题标题】:Text of ListView Subitems not updated when using AddRange (WinForms)使用 AddRange (WinForms) 时未更新 ListView 子项的文本
【发布时间】:2018-12-05 09:14:52
【问题描述】:

更新 ListView 项的子项文本后,新文本不会显示在 ListView 中。 失效、更新、重绘、刷新都无济于事。

我使用 AddRange 添加子项。

我可以做些什么来反映 UI 上的变化?

【问题讨论】:

  • 数据源是否分配给了listview?

标签: c# .net winforms listview


【解决方案1】:

正如KevinBuithis article "C# setting ListView's Item's Subitem's text does not display" 中指出的那样,由于.NET Framework 中的错误,当使用ListView.AddRange 添加子项时,新的子项文本不会显示在ListView 中。

不要使用 AddRange,而是使用 Add

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-25
    • 2010-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多