private void InitModel() { // Create the model model = new TreeGridModel(); // Add a bunch of items at the root for (int count = 0; count < Roots; count++) { // Create the root item Item root = new Item(String.Format("Root {0}", count), value++, true); // Add children to the root AddChildren(root); // Add the root to the model model.Add(root); } }
/// <summary> /// 初始化模型 /// </summary> private void InitModel() { // Create the model model = new TreeGridModel(); // Add a bunch of items at the root for (int count = 0; count < Roots; count++) { // Create the root item int num = value++; Item root = new Item($"Root {count}", num, $"这是备注字段{num}", true); // Add children to the root AddChildren(root); // Add the root to the model model.Add(root); } }