1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Image Library Dropdown

Image Library Dropdown

4 posts, 0 answered
  1. Scott Williams
    Scott Williams avatar
    14 posts
    Registered:
    13 Oct 2009
    17 Nov 2009
    Link to this post
    First off just want to say thanks to the telerik for there support in these forums, your really doing an ace job.

    Basically what I'm trying to achieve is a simple dropdown that lists all the image galleries that I have created. I have tried to use the blog archive control but so far have had no luck. Is this something that's easy to do? 
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    17 Nov 2009
    Link to this post
    Hello Scott Williams,

    The logic below will populate a DropDownList control with all libraries of type "Image" that you have created.

    LibraryManager libManager = new LibraryManager("Libraries");
    IList libraries = libManager.GetAllLibraries("Image", true);
    DropDownList1.DataSource = libraries;
    DropDownList1.DataTextField = "Name";
    DropDownList1.DataBind();

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Scott Williams
    Scott Williams avatar
    14 posts
    Registered:
    13 Oct 2009
    18 Nov 2009
    Link to this post
    Thanks for the code above. I now have a dropdown that displays a complete list of all image libraries.

    I would also like to make each item in the dropdown list clickable. So you click the dropdown list then select an image library from the dropdown which would reload either the page of just the images to show only the images from your chosen library. Can you help?

    So the end result would be a clickable dropdown list that would display only the image library chosen. 
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Nov 2009
    Link to this post
    Hello Scott Williams,

    You can subscribe for SelectedIndexChanged event of the control and set AutoPostBack = true;

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered