New File Indicator

2 posts, 0 answers
  1. Vinh
    Vinh avatar
    24 posts
    Member since:
    Jul 2010

    Posted 19 Mar 2012 Link to this post

    Hi, I'm looking an either client-side or server-side to either append '*' to the Folder Name or switch the icon.  Right now, we're only allowing members to download the files and we keep that the download status.

    Vinh Vu
  2. Dobromir
    Dobromir avatar
    1633 posts

    Posted 21 Mar 2012 Link to this post

    Hi Vinh,

    I already answered your support ticket on the subject. For convenience I will paste my answer here as well.

    If I understand you correctly, you need to mark the newly uploaded files with a marker in the file list. RadFileExplorer does not offer such functionality out-of-the-box. Nevertheless, to achieve this I would suggest you to sub-class the FileSystemContentProvider class and override its StoreFile() and ResolveDirectory() methods.
    1. In the StoreFile() method save information of the uploaded file(for example in a database) to mark it as latest upload.
    2. In the ResolveDirectory() check if any of the files is marked as latest upload, and if so add a custom attribute to it (as demonstrated in this live demo).
    3. Handle the RadFileExplorer's ClientFolderLoaded client-side event and change the icon of the grid's row, e.g.:
      function OnClientFolderLoaded(oExplorer, args)
          var dataItems = oExplorer.get_grid().get_masterTableView().get_dataItems();
          for (var i = 0; i < dataItems.length; i++) {
              //get reference to the data item
              var item = dataItems[i];
              //get the value of the "CustomAttribute"
              var itemCustomAttribute = item.get_dataItem().Attributes["CustomAttribute"];
              if (itemCustomAttribute == "CustomAttributeValue") {
                  //change the background image
                  $telerik.$("td:first-child", item.get_element()).css("background-image", "url('latestUploadIcon.gif')");

    More information regarding the RadFileExplorer's content provider is available in the following help article:
    Using custom FileBrowserContentProvider

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top