SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to fetch all the list titles of the current site in a dropdown in my web part's editor part. Based on this selection I want to show list items in web part when Apply is hit.

My web part is deployed at site collections level.

share|improve this question

Get the List title source:

public static IList<String> GetAllListTitle(SPWeb web)
    List<String> title = new List<String>();

    foreach(SPList list in web.Lists)

Have a look at these for how to implement dynamic dropdown as webpart property.

share|improve this answer

Use this code to populate the dropdown list.

    SPWeb web = SPContext.Current.Web;
    foreach(SPList list in web.Lists)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.