Setting ImagesFolderPath at runtime

6 posts, 0 answers
  1. Doug
    Doug avatar
    14 posts
    Member since:
    Apr 2013

    Posted 29 Apr 2014 Link to this post

    So I am trying to set the ImagesFolderPath at runtime, but am having problems please help.

    Let me setup the scenario first.... I have a webpage that has several different controls.  One control is a dropdown list that contains numeric codes.  When a code is selected it populates the rest of the page.  I want to set the ImagesFolderPath, once this numeric code is selected.  I have tried putting code in the Load and Databinding events the ImageGallery never reloads.  The control just sits on the page and does not appear to ever reload or rebind with the new ImagesFolderPath.


    Please help


    Doug
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 02 May 2014 Link to this post

    Hello Doug,

    Thank you for contacting us.

    I have created a sample RadGrid web site to demonstrate how you can achieve the requested functionality. Please run the attached application and let me know if it helps you.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brian
    Brian avatar
    3 posts
    Member since:
    Dec 2014

    Posted 13 Dec 2014 in reply to Eyup Link to this post

    I have a similar problem when trying to change the ImagesFolderPath from code. So does this mean that this property is design time only? It would be helpful if the documentation said so.

    The sample application you provided does work but it adds quite a bit of complexity to the page code just to change a single property. It is not immediately apparent how to change that property in the sample other than by use of the combobox in the example. That is impractical for my project. I just want to pass a variable to the gallery.

    Do you have a sample that shows how this can be done?
  5. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 17 Dec 2014 Link to this post

    Hi Brian,

    With the next release you will simply be able to use the following approach in order to achieve this requirement:
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadImageGallery1.ImagesFolderPath = "DifferentPath";
        RadImageGallery1.CurrentItemIndex = 0;
        RadImageGallery1.Rebind();
    }

    Until then, I'm afraid there is no alternative solution than the approach demonstrated in the mentioned sample.

    Please free to let us know if new questions arise.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. ANGEL
    ANGEL avatar
    1 posts
    Member since:
    Sep 2016

    Posted 05 Sep Link to this post

          RadImageGallery1.ImagesFolderPath = "images";
                RadImageGallery1.DataBind();
  7. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 08 Sep Link to this post

    Hi Angel,

    I'm not sure what you had in mind, but the Rebind() method should work pretty good, too.
    You can also check the following code-library for customizing the RadImageGallery control:
    http://www.telerik.com/support/code-library/add-print-and-save-buttons-in-radimagegallery-toolbar
    http://www.telerik.com/support/code-library/access-unique-datakeyvalue-and-delete-images-from-radimagegallery-bound-to-a-data-source

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017