add custom text along file name.

4 posts, 0 answers
  1. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 17 Jul 2013 Link to this post

    Hi

    On uploading files the file name is rendered below the control. There can I add custom text along with the file name?

    Thanks
    Sameer
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Jul 2013 Link to this post

    Hi Sameer,

    One suggestion is you can make use of the Additional Fields property to achieve your requirement. Please have a look at the JavaScript code I tried to create a label where you can give your custom text.

    JavaScript:
    <script type="text/javascript">
        var $ = $telerik.$;
        function onClientFileUploaded(radAsyncUpload, args) {
            var $row = $(args.get_row());
            var label = createLabel();
            $row.append(label);  
        }
        function createLabel() {
            var label = '<label>Custom Text</label>';
            return label;
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 17 Jul 2013 Link to this post

    Thanks. This is what I needed but the custom text is appearing before the file name. I need to place the text after the file name. Please help.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Jul 2013 Link to this post

    Hi Sameer,

    Try overriding the default CSS as follows.

    CSS:
    <style type="text/css">
        .ruInputs label
        {
            margin: -26px 0 0 138px !important;
            float: none !important;
            text-align: left !important;
        }  
        .RadUpload_Default .ruRemove
        {
            margin-left: 150px !important;
        }
    </style>

    Thanks,
    Shinu.
Back to Top