473,289 Members | 2,155 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,289 software developers and data experts.

Binding to Hierarchical Data Source (FAQs)

Hi,

I have some hierarchical data (FAQs) that I would like to bind to. The basic
structure is:

FAQ Category
+ Categories
+ FAQs

So an FAQ category has any number of sub-categories and any number of FAQs.
I want to display this structure on a web page so that it looks something
like this:

FAQ Category 1
FAQ 1.1
FAQ 1.2
FAQ Category 2
FAQ 2.1
FAQ 2.2
FAQ Category 2.1
FAQ 2.1.1

etcetera. I am confused about how to do this though. Firstly, I don't want
to use the XmlDataSource since my structure is not in XML. So I figured I'd
write my own FAQDataSource. Even if I do that though, which control should I
use to display this? The tree control doesn't allow me to customise the
display enough (no templates). The menu control doesn't allow me to
customise leaf nodes (FAQs) and non-leaf nodes (FAQ categories) separately.

Is there some other control I should be using for this? I thought about
using GridViews recursively but am not sure whether that's a good option...

Please advise,
Kent
Feb 1 '06 #1
5 2642
DWS
Kent,
You could write a class that inherits from HierarchicalDataSourceControl
Then bind to a treeview this is Kindof advanced but there's an example to
display the file system in vs 2005 help.
http://msdn2.microsoft.com/en-us/lib...cecontrol.aspx

Good Luck
DWS
"Kent Boogaart" wrote:
Hi,

I have some hierarchical data (FAQs) that I would like to bind to. The basic
structure is:

FAQ Category
+ Categories
+ FAQs

So an FAQ category has any number of sub-categories and any number of FAQs.
I want to display this structure on a web page so that it looks something
like this:

FAQ Category 1
FAQ 1.1
FAQ 1.2
FAQ Category 2
FAQ 2.1
FAQ 2.2
FAQ Category 2.1
FAQ 2.1.1

etcetera. I am confused about how to do this though. Firstly, I don't want
to use the XmlDataSource since my structure is not in XML. So I figured I'd
write my own FAQDataSource. Even if I do that though, which control should I
use to display this? The tree control doesn't allow me to customise the
display enough (no templates). The menu control doesn't allow me to
customise leaf nodes (FAQs) and non-leaf nodes (FAQ categories) separately.

Is there some other control I should be using for this? I thought about
using GridViews recursively but am not sure whether that's a good option...

Please advise,
Kent

Feb 1 '06 #2
As there is no class that supports your structure directly, you are going to
have to create your own mechanism to either a) turn into a type of structure
that is supported by databinding or b) write your own parser and display
elements.

DWS has a decent suggestion. Conversion of your material to XML is another
decent option (allows storage in the method you current have, but binds as
XML).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Kent Boogaart" wrote:
Hi,

I have some hierarchical data (FAQs) that I would like to bind to. The basic
structure is:

FAQ Category
+ Categories
+ FAQs

So an FAQ category has any number of sub-categories and any number of FAQs.
I want to display this structure on a web page so that it looks something
like this:

FAQ Category 1
FAQ 1.1
FAQ 1.2
FAQ Category 2
FAQ 2.1
FAQ 2.2
FAQ Category 2.1
FAQ 2.1.1

etcetera. I am confused about how to do this though. Firstly, I don't want
to use the XmlDataSource since my structure is not in XML. So I figured I'd
write my own FAQDataSource. Even if I do that though, which control should I
use to display this? The tree control doesn't allow me to customise the
display enough (no templates). The menu control doesn't allow me to
customise leaf nodes (FAQs) and non-leaf nodes (FAQ categories) separately.

Is there some other control I should be using for this? I thought about
using GridViews recursively but am not sure whether that's a good option...

Please advise,
Kent

Feb 1 '06 #3
Thanks guys. Actually, I already started down the path of implementing my
own data source. Then I thought "which control will I use to display the
data?". As I mentioned, the tree control isn't flexible enough for me (no
templates) and the menu control doesn't allow different templates for leaf /
non-leaf nodes (in other words, I can't display the FAQ category differently
to the FAQ, which is obviously required).

So assuming I have my custom data source, do you have a suggestion for which
control I could use to display it?

Thanks,
Kent

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:4B**********************************@microsof t.com...
As there is no class that supports your structure directly, you are going
to
have to create your own mechanism to either a) turn into a type of
structure
that is supported by databinding or b) write your own parser and display
elements.

DWS has a decent suggestion. Conversion of your material to XML is another
decent option (allows storage in the method you current have, but binds as
XML).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Kent Boogaart" wrote:
Hi,

I have some hierarchical data (FAQs) that I would like to bind to. The
basic
structure is:

FAQ Category
+ Categories
+ FAQs

So an FAQ category has any number of sub-categories and any number of
FAQs.
I want to display this structure on a web page so that it looks something
like this:

FAQ Category 1
FAQ 1.1
FAQ 1.2
FAQ Category 2
FAQ 2.1
FAQ 2.2
FAQ Category 2.1
FAQ 2.1.1

etcetera. I am confused about how to do this though. Firstly, I don't
want
to use the XmlDataSource since my structure is not in XML. So I figured
I'd
write my own FAQDataSource. Even if I do that though, which control
should I
use to display this? The tree control doesn't allow me to customise the
display enough (no templates). The menu control doesn't allow me to
customise leaf nodes (FAQs) and non-leaf nodes (FAQ categories)
separately.

Is there some other control I should be using for this? I thought about
using GridViews recursively but am not sure whether that's a good
option...

Please advise,
Kent

Feb 1 '06 #4
Kent,
Have you looked at this sample made by phillip at:-
http://www.societopia.net/samples/webform2.aspx
or another option is u should be able to use the treeview webcontrol ver
1.1 and bind your data to it..
Hope that helps
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Feb 2 '06 #5
Kent,

I think a Grid Control that supports Hierarchical data is ideal for
you.

Essential Grid for ASP.Net from Syncfusion could be the right control
for you. It's not free though.

Take a look at the heirarchical grid samples here:
http://www2.syncfusion.com/2.0/samples.aspx

.... and browse to Grid.Grouping.Web/Hierarchies node on the left.

In ASP.Net 1.1, it's very easy to bind the grid to your data sources.
Just setup the heirarchical relationship between your sql tables in the
DataSet and bind that DataSet to the grid.

In ASP.Net 2.0, you will have to setup the relationship in code though,
since there is no design time support for DataSet. Still, very easy to
set it up.

Contact our support if you have more questions.

Regards,
Praveen Ramesh
Syncfusion, Inc.
www.syncfusion.com

Feb 2 '06 #6

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

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
5
by: Greg Dunn | last post by:
I have two tables in a parent-child relationship. Details on the tables are as shown below: Table1 ------- Item_ID (primary key) Item_Owner (foreign key to Table2) Table2 -------
4
by: Daisy | last post by:
Let's say I've got a forum, where users can be moderators of each forum. Tables look like this: USER -------- user_key name FORUM
3
by: neverstill | last post by:
So I thought I had a solution to my problem using DataRelations with the DataSet. I need to display hierarchical data. I have a DataList nested into another DataList. My datasource is a...
19
by: Larry Lard | last post by:
In the old days (VB3 era), there was a thing called the Data Control, and you could use it to databind controls on forms to datasources, and so (as the marketing speak goes), 'create database...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
0
by: =?Utf-8?B?SmVmZiBHYW8=?= | last post by:
Hi, I am working on an asp.net web application that uses treeview control to display hierarchical data from an xml data source. When I changed the xml data source the treeview doesn’t update...
2
by: csharpula csharp | last post by:
Hello, I am trying to bind tree view. I got an object which is representing the tree nodes (hierarchical). How can I implement this? Thanks! *** Sent via Developersdex...
5
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a custom control (not a listbox or other hierarchical or list control) that I would like to bind to a specific row and column from a DataTable. Each row of the datatable will...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.