hierarchical-data

How do I display a DataGridView within a cell of another datagridview in C# forms app?

How do I display a DataGridView within a cell of another datagridview in C# forms app? How would I have to handle Sorting & value changed if this possible? That is the only way I can display data to make some sense.. Think of it like I have a task column and dates column. Under the dates column I have a list of things to be done. These...

How do I display non-normalized data in a hierarchical structure?

My issue is that I want to display data in a hierarchal structure as so: Democrat County Clerk Candidate 1 Candidate 2 Magistrate Candidate 1 Candidate 2 Candidate 3 But I'm retrieving the dataset like this: Party | Office | Candidate -------------------------------------------- Democrat | County Clerk | Candidate 1 Democrat |...

Turn database result into array

Hi everyone, I have just made the update/add/delete part for the "Closure table" way of organizing query hierarchical data that are shown on page 70 in this slideshare: http://www.slideshare.net/billkarwin/sql-antipatterns-strike-back My database looks like this: Table Categories: ID Name 1 Top value 2 Sub v...

how to convert Database Hierarchical Data to XML using ASP.net 3.5 and LINQ

hello guys! i have a table with hierarchical structure. like this: and table data shown here: this strategy gives me the ability to have unbounded categories and sub-categories. i use ASP.net 3.5 SP1 and LINQ and MSSQL Server2005. How to convert it to XML? I can Do it with Dataset Object and ".GetXML()" method. but how to implement ...

Algorithm for parsing a flat tree into a non-flat tree

I have the following flat tree: id name parent_id is_directory =========================================================== 50 app 0 1 31 controllers 50 1 11 application_controller.rb 31 0 46 models 50 ...

Hierarchical SQL query not returning level

I have a typical SQL Server hierarchical query: WITH bhp AS ( SELECT name, 0 AS level FROM dbo.BhpNode WHERE parent_id IS NULL UNION ALL SELECT a.name, level + 1 FROM dbo.BhpNode a INNER JOIN dbo.BhpNode b ON b.bhp_node_id = a.parent_id ) SELECT * FROM bhp This seems to match the various examples of hierar...

Algorithm for converting hierarchical flat data (w/ ParentID) into sorted flat list w/ indentation levels

I have the following structure: MyClass { guid ID guid ParentID string Name } I'd like to create an array which contains the elements in the order they should be displayed in a hierarchy (e.g. according to their "left" values), as well as a hash which maps the guid to the indentation level. For example: ID Name ParentI...

How can I get a distinct list of elements in a hierarchical query?

I have a database table, with people identified by a name, a job and a city. I have a second table that contains a hierarchical representation of every job in the company in every city. Suppose I have 3 people in the people table: [name(PK),title,city] Jim, Salesman, Houston Jane, Associate Marketer, Chicago Bill, Cashier, New York ...

Excel layout for hierarchical data

I am working on an excel bulk upload feature which has to be parsed using Java API. My problem is designing its layout. The data is hierarchical with 4 levels and one to many relationship at each level. 1-other data for node 1 -2-other data for node 2 -3-other data for node 3 -4-other data for node 4 And this repeats e.g. -...

LINQ2SQL: orderby note.hasChildren(), name ascending

I have a hierarchical data structure which I'm displaying in a webpage as a treeview. I want to data to be ordered to first show nodes ordered alphabetically which have no children, then under these nodes ordered alphabetically which have children. Currently I'm ordering all nodes in one group, which means nodes with children appear nex...

Tree data structure in php

in my application user starts a new tree or get added under a child-user and keep on adding users in branches in such a way- >there are 10 level of tree type structure. >root node contain 1 user and each node(user) can have max 5 child-user in this way tree will be like level 0 = 1 user , level 1 = 5 user, level 2 = 25 user , level 3 =...

Is it Possible to Use Constraints on Hierarchical Data in a Self-Referential Table?

Suppose you have the following table, intended to represent hierarchical data: +--------+-------------+ | Field | Type | +--------+-------------+ | id | int(10) | | parent | int(10) | | name | varchar(45) | +--------+-------------+ The table is self-referential in that the parent_id refers to id. So you might ha...

How to identify orphaned nodes

I have a hierarchy of nodes stored in DB. I select all, store them in an array, then iterate over them and create a nested array in memory. The input looks like this: [{name: A}, {name: B}, {name: X, parent: A}, {name: Y, parent: A}, {name: C}] The output looks like this: [{name: A, children:[{name: X}, {name: Y}]}, {B}, {C}] ...

jQuery: Sorting hierarchical data?

Hi everybody, I have tried for some time to work out a way of sorting nested categories with jQuery. I failed to build my own plugin to do this, so I tried to find something that were available already. Tried a few hours now with this one, http://www.jordivila.net/code/js/jquery/ui-widgetTreeList_inheritance/widgetTreeListSample.aspx an...

Find node level in a tree

I have a tree (nested categories) stored as follows: CREATE TABLE `category` ( `category_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `category_name` varchar(100) NOT NULL, `parent_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`category_id`), UNIQUE KEY `category_name_UNIQUE` (`category_name`,`parent_id`), KEY `fk_categor...

The best practice to setup hierarchy data

I'm trying to figure out the best practice to setup hierarchy data that i take from a database into some contoller that would show the hierachy. Basicly this would look like a normal tree but when you press the items that are under "chapters" you get a link to another page. I have these tables and this is the way they are connected Per...

how to return static variable PHP

function build_path($cid) { static $fr=array(); $DB = new MySQLTable; $DB->TblName = 'shop_categories'; $where['cat_id']['='] = $cid; $res = $DB->Select('cat_id,cat_name,cat_parent', $where); if($res !== false) { $pid = mysql_fetch_array($res); if($pid['cat_parent'] !== "0") { ...

Return node level of hierarchical xml

In a treeview you can retrieve the level of an item. I am trying to accomplish the same thing with the given input being an object. The XML data I will use for this example would be something like the following <?xml version="1.0" encoding="utf-8" ?> <Testing> <Numbers> <Number val="1"> <Number val="1.1"> <Number v...

IN R counting hierarchical data

I have a list of counties in each state that received nonattainment status in years 1995-2005. I want to know how many counties in each state each year that received this status. If my data is formatted like this, State1 Country1 YR1 Yr2 Yr3 Yr4... State1 Country2 YR1 Yr2 Yr3 Yr4 State2 County1 Yr1 Yr2..... Each year variable coul...

GUI tools and APIs for small/medium hierarchical data structures

Hi, I'm trying to find a tool and library to edit, write and read data in a hierarchical structure, similar to an LDAP tree, a Windows registry or a Berkeley DB structure. The keys should represent some hierarchy, and the values should have a relatively flexible format (typing is optional, but could be useful). Here is an example: Item...