Created
June 16, 2013 23:55
-
-
Save DaveGoosem/5793913 to your computer and use it in GitHub Desktop.
Populate Drop Down List with Sitecore data template items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//IncidentCategoryList is the list control | |
//In this example we are only showing child items of the datasourced item which are using a specific Sitecore template named 'IncidentCategory' | |
foreach ( | |
var categoryDropDownItem in | |
DataSourceItem(IncidentCategoryItemId).Children.Where(z => z.TemplateName == "IncidentCategory")) | |
{ | |
IncidentCategoryList.Add(categoryDropDownItem.DisplayName); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment