I would like to Add a开发者_高级运维 dropdownlist to edit webpart properties and bind it with all document library list available in sharpoint 2010.
Thank you for your Help.
You need to create Custom Web Part Editor with DropDownList
Creating a Custom Web Part Editor in SharePoint 2010
and using SharePoint Object Model to fill this dropdownlist like this (not tested):
SPListCollection docLibraryColl = SPContext.Current.Web.GetListsOfType(SPBaseType.DocumentLibrary);
foreach (SPList list in docLibraryColl)
{
SomeDropDownList.Items.Add(list.Title, list.Id);
}
精彩评论