开发者

Edit Webpart properties with dynamic dropdownlist

开发者 https://www.devze.com 2023-03-25 18:36 出处:网络
I would like to Add a开发者_高级运维 dropdownlist to edit webpart properties and bind it with all document library list available in sharpoint 2010.

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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消