473,394 Members | 1,965 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,394 software developers and data experts.

Best way to build a control for a recursive relationship

Hi,

I'm building a CMS and I'm banging my head against the wall over one
part of the user interface. I have a Section entity which maybe have 0
or 1 parent Sections.

So, as an example, I could have a "Media" section which is the parent
to a "New Release" section which is a parent to a "Recent Releases"
section. I need to build a control that expresses the recursive
relationship of each section to its parent, but it needs to be
flexible enough so that I can edit each section's properties, or add
child sections intuitively.

I have been trying to use a Repeater to emit a table, but the records
can't be grouped in a hierarchical relationship which would immensely
improve negotiating the structure of the site. A list springs to mind,
has anyone seen a control that does something like what I'm looking
for?

Regards,

Chris

Feb 22 '07 #1
2 1434

Hi Chris,

You need to use a Treeview type control.

I don't think there is a treeview in the standard control set, so check
out the one at www.telerik.com

We use their entire control set.

Paul

ha******@hotmail.com wrote:
Hi,

I'm building a CMS and I'm banging my head against the wall over one
part of the user interface. I have a Section entity which maybe have 0
or 1 parent Sections.

So, as an example, I could have a "Media" section which is the parent
to a "New Release" section which is a parent to a "Recent Releases"
section. I need to build a control that expresses the recursive
relationship of each section to its parent, but it needs to be
flexible enough so that I can edit each section's properties, or add
child sections intuitively.

I have been trying to use a Repeater to emit a table, but the records
can't be grouped in a hierarchical relationship which would immensely
improve negotiating the structure of the site. A list springs to mind,
has anyone seen a control that does something like what I'm looking
for?

Regards,

Chris
Feb 23 '07 #2
The UI setup in this case indeed looks like a typical treeview /
treelist control. The setup for creating this UI part with the
suggested telerik treeview control is indeed very easy - you just need
to populate a ADO.NET DataTable with the data needed and make sure you
have two additional columns for ID -ParentID relation. Code can be
somethngi similar to this:
OleDbConnection dbCon = new OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/
TreeView/Data/Tree.mdb"));
dbCon.Open();

OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM Nodes",
dbCon);
DataSet ds = new DataSet();
dapter.Fill(ds);

RadTree1.DataFieldID = "id";
RadTree1.DataFieldParentID = "parentId";

RadTree1.DataSource = ds;
RadTree1.DataBind();

Mar 3 '07 #3

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

Similar topics

5
by: Alex Polite | last post by:
I need to put recursive data structures on disc and found out that cPickle doesn't like recursion. What are my options? alex -- Alex Polite http://polite.se
19
by: Steve Jorgensen | last post by:
I've run across this issue several times of late, and I've never come up with a satisfactory answer to the best way to handle this schema issue. You have a large section of schema in which a...
3
by: MDS | last post by:
All, I would like to implement a recursive relationship in a table with referential integrity enforced and cascade update turned on. For example, a horse has a sire and dam. Both the sire and...
64
by: dmattis | last post by:
I am trying to write a recursive version of Power(x,n) that works by breaking n down into halves(where half of n=n/2), squaring Power(x,n/2), and multiplying by x again if n was odd, and to find a...
4
by: paula | last post by:
I've got a problem with asp.net i am trying to make a menu control. and have searched the web for serveral controls but they don't work correctly. I am pretty new to asp.net building. What am i...
3
by: Robert Ludig | last post by:
I am fairly new to SQL and I am currently trying to create a SQL table (using Microsoft SQL) that has a recursive relationship, let me try to explain: I have a piece of Data let's call it "Item"...
4
by: so.intech | last post by:
for example, ret = 0; for(i=0; i<3; i ++;) { for(j=0; j<4; j++;) { for(k=0; k<3; k++;) { for(m=0; m<4; m++;) {
2
by: Ashley | last post by:
hey, what's up............................. "Neil" <nospam@nospam.netwrote in message news:8YFwj.10509$0o7.1113@newssvr13.news.prodigy.net...
8
by: Pivot_Tables | last post by:
Hi, I have created a recursive SQL Query in DB2 and it works fine until some point in the tree where the data gets into infinite loop. Below are some sample data from my relationship table. ...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.