Back to Devexpress

How to: Init New Nodes

aspnet-4695-components-tree-list-examples-how-to-init-new-nodes.md

latest972 B
Original Source

How to: Init New Nodes

  • Dec 17, 2020

This example shows how to initialize new node values by handling the ASPxTreeList.InitNewNode event.

The image below shows the result:

csharp
protected void ASPxTreeList1_InitNewNode(object sender,
DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e) {
    e.NewValues["Budget"] = 500000;
    e.NewValues["Location"] = "Monterey";
}
vb
Protected Sub ASPxTreeList1_InitNewNode(ByVal sender As Object,_
ByVal e As DevExpress.Web.Data.ASPxDataInitNewRowEventArgs) Handles ASPxTreeList1.InitNewNode
    e.NewValues("Budget") = 500000
    e.NewValues("Location") = "Monterey"
End Sub

To learn more, see Adding and Deleting Nodes.