473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Collapsible Grid/Tree

I have a pair of database tables with a structure similar to the
following:

--------------------------------------------
Table: Category
--------------------------------------------
CategoryID | CategoryName | ParentCategoryID

1 | 'A' | 0
2 | 'B' | 0
3 | 'AA' | 1
4 | 'AB' | 1
5 | 'BA' | 2
6 | 'BAA' | 5

-----------------------
Table: Budget
-----------------------
BudgetID | BudgetAmount

3 | $10
4 | $30
6 | $15

Hopefully it is clear that the Category table is a hierarchical tree
structure. Each Category record contains a parent ID that points to
another Category record in the same table. Categories with a parent ID
of 0 are at the top of the hierarchy, while a category that has a
non-zero parent ID is a sub-category. The categories without any
sub-categories have an associated record in the budget table. There is
no limit to how many levels deep the tree will go, and not all
categories will have the same number of levels of sub-categories.

I need to display this data as a table on a web form so that the
Categories can be expanded/collapsed to show/hide their sub-categories.
Also, when a category row is in a collapsed state, it should show the
sum of the amounts contained in its sub-categories.

I know there are 3rd party controls that can probably handle these
requirements, but it is preferred that this web form be built using
only the standard ASP.Net 2.0 controls. I've also come across a few
articles that describe nesting controls, but that's not exactly what I
want either... I don't want tables within tables, which would result in
columns that don't line up properly (there will actually be about a
dozen "amount" columns associated with each category), but just one
single table with the collapsed categories "hidden".

This seems like it would be a relatively common thing to do, but I
haven't been able to find any examples to get me started. How would you
recommend going about this? Which control would be best suited
(Repeater, DataList, DataGrid, GridView, etc)? Can the TreeView help me
at all? Would the GridView provide any benefits over the DataGrid in
this scenario? Thanks!

Feb 27 '06 #1
0 1582

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Richard Lewis | last post by:
Hi there, I've got a tree control in Tkinter (using the ESRF Tree module) but I can't get it to layout how I want it. I'd like to have it so that it streches north/south (anchored to the top...
0
by: BH | last post by:
Hi, I am trying to build my own IHM with two treeCtrl and 1 grid, based on the wx.aui demos. My problem is with the Grid. It dosen't have scrollbars. I tried many methods (fit) but it always...
7
by: moondaddy | last post by:
I have WPF window and a grid. The grid has several columns and rows. How do I add an object to a specific row and column of the gird using c#? If I use: myGrid.Children.Add(dg); then dg...
5
by: gdesou | last post by:
I'm after a grid or list able to display hierarchical items and that is able to collapse to parent items. I Google it for possible solutions but I only get commercial products or reference to...
7
by: David T. Ashley | last post by:
I'm trying to implement these ... I know there is a lot of example code on the web, but I'm trying to roll my own ... What JavaScript functionality is typically used to display parts of the...
1
by: mahesh123 | last post by:
I am using Collapsible Panel in my project.But in other form of my project i want to use collapsible panel inside other Collapsible panel.Is it possible. Both panels are to be dinamic.Is it possible...
2
by: =?ISO-8859-1?Q?Marco_K=F6rner?= | last post by:
Hello, I'm working on mapping the car's environment by updating an occupancy grid. An occupancy grid dicretizes the 3D space in small grid elements (voxels). A grid element contains informations...
2
by: Effanbee | last post by:
Hi Everybody, Does anybody have an idea for a collapsible grid? I have a grid (ProductsList) displaying several rows. Several of the rows have one column in common ("Product Type"). The goal...
5
by: veenna | last post by:
i have a grid inside a collapsible panel in my page. on expand of collapsible panel i want to bind data to grid. how can i do this? how to get the events of collapsible panel. please help ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.