簡體   English   中英

winform/radtreeview/c#:在帶有 DataSource 的 winform 中使用 RadTreeview

[英]winform/radtreeview/c#: using RadTreeview in winform with DataSource

我需要使用telerik的 RadTreeView 來顯示客戶端樹。 使用 Nodes.Add 太慢了,我想知道使用樹的DataSource並在那里設置我的查詢的替代方法。

我的 dto 是:

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

是否可以使用數據源

根據提供的信息,我可以建議您兩種選擇:

  1. 按需加載數據:此功能有助於降低同時加載所有節點時產生的性能和 memory 成本。 以下幫助文章演示了如何使用它的示例方法: https://docs.telerik.com/devtools/winforms/controls/treeview/data-binding/load-on-demand

  2. 數據綁定到自引用數據:當您有單個對象集合時適用,其中每個 object 都有一個 ID 和 ParentID: https://docs.telerik/treeviews/devs-binding/binding-to-control -自引用數據

我希望這個信息幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM