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

Forums / Set-up & Installation / Image files view on CMS 3.7

Image files view on CMS 3.7

3 posts, 0 answered
  1. Wilson Ochoa
    Wilson Ochoa avatar
    33 posts
    Registered:
    18 May 2010
    29 Aug 2010
    Link to this post
    Hi team;

    Is there any setup to image view files inside the CMS?  its would be really helpful to have this on.

    SEE attached.

    thank  you Wilson
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Aug 2010
    Link to this post
    Hi Wilson Ochoa,

    There is no built-in option that allows you to preview the items in FileManager control. The easiest option to preview the image is enabling files download for the file manager and hide the "download' link for items which extension is not valid for an image.

    Inside ~/Sitefinity/Admin/Files.aspx.cs override OnPreRender and there subscribe to PreRender event of the RadGrid ( radGrid.PreRender += new EventHandler(radGrid_PreRender);). The disable all links for items which are not images

    sample

    void radGrid_PreRender(object sender, EventArgs e)
    {
       var grid = (Telerik.Web.UI.RadGrid)(sender);
     
       foreach (var itm in grid.Items)
       {
           if (itm is GridDataItem)
           {
               GridDataItem dataItem = itm as GridDataItem;
                
               var column = grid.MasterTableView.Columns.FindByUniqueNameSafe("DownloadLink");
               if (column != null && (!dataItem["Name"].Text.Contains(".jpg")))
               {
                   TableCell cell = dataItem["DownloadLink"];
                   cell.Text = "";
     
               }
     
           }
     
       }
     
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Wilson Ochoa
    Wilson Ochoa avatar
    33 posts
    Registered:
    18 May 2010
    30 Aug 2010
    Link to this post
    Thank you Ivan,

    We will have a look at this now.

    Regards,
    Wilson
Register for webinar
3 posts, 0 answered