【问题标题】:winform/radtreeview/c#: using RadTreeview in winform with DataSourcewinform/radtreeview/c#:在带有 DataSource 的 winform 中使用 RadTreeview
【发布时间】:2020-11-25 12:46:51
【问题描述】:

我需要使用 Telerik 的 RadTreeView 来显示客户树。使用 Nodes.Add 太慢了,我想知道使用树的 DataSource 并在那里设置我的查询的替代方法。

我的 dto 是:

public class DTOClient 
{
  public int Id {get; set;}
  public int ParentId {get; set;}
}

是否可以使用数据源

【问题讨论】:

    标签: c# winforms telerik


    【解决方案1】:

    根据提供的信息,我可以建议您两种选择:

    1. 按需加载数据:此功能有助于降低同时加载所有节点时产生的性能和内存成本。以下帮助文章演示了如何使用它的示例方法:https://docs.telerik.com/devtools/winforms/controls/treeview/data-binding/load-on-demand

    2. 数据绑定到自引用数据:当您有一个对象集合且每个对象都有一个 ID 和 ParentID 时适用:https://docs.telerik.com/devtools/winforms/controls/treeview/data-binding/binding-to-self-referencing-data

    我希望这些信息对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2011-08-28
      • 1970-01-01
      • 2014-08-25
      • 1970-01-01
      • 2012-09-19
      • 1970-01-01
      • 2011-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多