Skip to content

Instantly share code, notes, and snippets.

@DaveGoosem
Created June 16, 2013 23:55
Show Gist options
  • Save DaveGoosem/5793913 to your computer and use it in GitHub Desktop.
Save DaveGoosem/5793913 to your computer and use it in GitHub Desktop.
Populate Drop Down List with Sitecore data template items
//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