Customize the value shown in the Size column

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

    Posted 15 Dec 2009 Link to this post


    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

    Customize the value shown in the Size column

    • 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.


  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
    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,
    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

This Code Library is part of the product documentation and subject to the respective product license agreement.