This is a migrated thread and some comments may be shown as answers.

Self referencing table and related combo boxes

1 Answer 47 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Laura
Top achievements
Rank 1
Laura asked on 17 May 2010, 03:46 PM
I successfully implemented the related comboboxes as in your example with region/country/state/city/... where my data was in separate tables - one for each level. The design of the database has changed, and the geographic data is now all in one table with a 2 id fields - one for the data and one for the parent making it a self referencing table, and the highest level has the parent as 0. So for example, Africa has a tid=22649 and parent=0 and then one of it's children is Eastern Africa with a tid=22661 and parent=22649.

There is not a set number of levels for any parent.

Are there any examples of how I can implement this new table layout in a related combobox?

Thanks,
Laura

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 21 May 2010, 08:31 AM
Hi Laura,

It is easy to create related RadComboBoxes populated with data from one self-reference database table.

Employees table form AdventureWorks demo database is the most popular example for self-reference table and is used in most online examples and in the T SQL documentation.
(AdventureWorks is free demo database and if you do not have it - you can download it from here).

That is why I made a sample for you based on our “Related Comboboxes” online demo and this database table. There are three RadComboBoxes at the example and the main idea there is to show the subordinates of each employee.
I made just a little change at the online demo code in order to be able to retrieve data from Employees table – I added “LoadData” method to retrieve data upon ManagerID parameter.

In order to be able to see actual employee-subordinate relation you can select the “adventure-works\roberto0” from the first RadComboBox and then “adventure-works\dylan0” RadComboBox.

Regards,
Kalina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Laura
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or