Customize the value shown in the Size column

3 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 15 Dec 2009 Link to this post

    Requirements

    RadControls version

    RadFileExplorer for ASP.NET AJAX
    .NET version

    2.0 / 3.5
    Visual Studio version

    2005 / 2008 /
    programming language JavaScript
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    Customize the value shown in the Size column

    THE IMPLEMENTATION
    • Attach a handler to the OnRowDataBound event of the RadGrid (embedded in RadFileExplorer) :
      protected void Page_Load(object sender, EventArgs e)
      {
          RadFileExplorer1.Grid.ClientSettings.ClientEvents.OnRowDataBound = "OnGridRowDataBound";
      }
    • Then implement the handler as follows:
      function OnGridRowDataBound(oGrid, args)
      {
          var dataItem = args.get_dataItem();
          if (dataItem.Length != null)
          {
              dataItem.Length = formatSizeValue(dataItem.Length);
          }
      }

    The full implementation of the described solution (including formatSizeValue method) can be found attached to the thread.

    THE RESULT

  2. WS
    WS avatar
    3 posts
    Member since:
    Jan 2010

    Posted 26 Jan 2010 Link to this post

    For those that need a little more in the formatSizeValue method, I adapted this from my C# tool kit.  It's a bit of an over kill but you can edit it as needed.  Just replace the one in the example code.

    Hope you find it useful.
  3. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 29 Jan 2010 Link to this post

    Hello WS,

    Thank you for the provided code. I believe that the provided JavaScript function will be of help for our  community.

    Best wishes,
    Fiko
    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.
Back to Top