Giter VIP home page Giter VIP logo

asp-net-web-forms-treeview-bind-to-plain-data-unbound-mode's Introduction

Tree View for ASP.NET Web Forms - How to bind the tree to plain data (Unbound mode)

This example demonstrates how to bind ASPxTreeView to data stored in DataTable. Nodes are created in unbound mode.

protected void Page_Load(object sender, EventArgs e) {
    DataTable table = GetDataTable();
    if (!IsPostBack)
        CreateTreeViewNodesRecursive(table, this.treeView.Nodes, "0");
}

private void CreateTreeViewNodesRecursive(DataTable table, TreeViewNodeCollection nodesCollection, string parentID) {
    for (int i = 0; i < table.Rows.Count; i++) {
        if (table.Rows[i]["ParentID"].ToString() == parentID) {
            TreeViewNode node = new TreeViewNode(table.Rows[i]["Title"].ToString(), table.Rows[i]["ID"].ToString());
            nodesCollection.Add(node);
            CreateTreeViewNodesRecursive(table, node.Nodes, node.Name);
        }
    }
}

Files to Review

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

asp-net-web-forms-treeview-bind-to-plain-data-unbound-mode's People

Contributors

devexpressexamplebot avatar lanadx avatar

Stargazers

 avatar

Watchers

Paul Usher avatar James Cloos avatar konyukhov.sergey avatar  avatar Don Wibier avatar zhavoronkov.evgeny avatar Maxim Litvinov avatar  avatar Julian M Bucknall avatar Alexey Serov avatar Andrey Belym avatar Mary Sammal avatar Mark Miller avatar  avatar Barkovskiy Maksim avatar Mikhail Preyskurantov avatar  avatar Christian Santos avatar  avatar  avatar  avatar  avatar Helen Wilde avatar Anthony Sam avatar A'Lex'ander avatar  avatar  avatar  avatar Alexander Russkov avatar  avatar  avatar  avatar  avatar Natalya Shtikel avatar EugeniyKiyashko avatar Viktor Shchelkunov avatar  avatar Alexander Zelevinskiy avatar Elena Soloveva avatar  avatar 71A1den avatar Oleg Luchnikov avatar  avatar Nick Mitrokhin avatar  avatar Jane Ryzhikova avatar  avatar Natalya Rodionova avatar Sergey Nakhankov avatar volvl avatar Max Erokhin avatar Roman Rodin avatar Serghey avatar Natalya Senichkina avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.