This is a migrated thread and some comments may be shown as answers.

radAsyncUpload file name get out of control width

4 Answers 166 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 23 Feb 2014, 04:59 PM
Hi all, I am using radAsyncUpload control, The problem I am facing is when a user select a file who's name is long than the file name exceeds the width of radAsyncUpload, I want the file name to be raped so that file name do not get out of radAsyncUpload border. please refer the attached screen shot.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Feb 2014, 04:13 AM
Hi Muhammad,

Please try the following CSS code snippet which works fine at my end.

CSS:
<style type="text/css">
    .ruUploadSuccess
    {
        width: 220px !important;
    }
    .ruUploadFailure
    {
        width: 220px !important;
    }
</style>

Thanks,
Shinu.
0
Muhammad
Top achievements
Rank 1
answered on 24 Feb 2014, 10:58 AM

Thank you for your reply, but this does not show the complete file name, is it possible to give a line feed when it reaches at maximum width.

Please refer the attached screen shot

Thanks
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2014, 11:11 AM
Hi Muhammad,

Please try the following sample code snippet which works fine at my end.

ASPX:
<telerik:RadAsyncUpload OnClientFileUploaded="fileSelected" ID="RadAsyncUpload2"
    runat="server">
</telerik:RadAsyncUpload>

CSS:
<style type="text/css">
    span
    {
        height: 50px !important;
        white-space: pre !important;
    }
</style>

JavaScript:
<script type="text/javascript">
    function fileSelected(sender, args) {
        var $span = $telerik.$(".ruUploadProgress", args.get_row());
        var name = $span.text();
        var number = (name.length) / 2;
        if (name.length > 15) {
            var newString = name.substring(0, number) + "\n" + name.substring(number, name.length);
            $span.text(newString);
        }
    }
</script>

Thanks,
Shinu.
0
Muhammad
Top achievements
Rank 1
answered on 26 Feb 2014, 04:36 AM
hi,
    Thank you for your time.

I have checked the code, and it is working as expected with just a little change

I used OnClientFileSelected event instead of OnClientFileUploaded.

Thanks
Tags
AsyncUpload
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Muhammad
Top achievements
Rank 1
Share this question
or