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

How to remove Path Name in GridAttachment Column, also do not show Path in upload window..

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gc_0620
Top achievements
Rank 1
gc_0620 asked on 09 Jul 2010, 09:07 PM
Hi,

Environment: VS 2008 SP1, RadControls for ASP.NET AJAX Q1 2010 NET35.

I am using below link as a prototype...

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx

My question: Is it possible to remove the path name from Gridattachment column as well as in Upload window. I mean I do not want to see C:\fakepath\ViewState.gif in upload window as well as in Gridattachment column in Radgrid. I would like to see just ViewState.gif


Please see attached. Thanks

Gc_0620

1 Answer, 1 is accepted

Sort by
0
gc_0620
Top achievements
Rank 1
answered on 10 Jul 2010, 04:58 PM

Solved.. Changes are in Italic.

  But unsure it is the best way. 

Thanks

GC_0620
________________
 

 

 
function uploadFileSelected(sender, args)
                {
                    upload = sender;
                    var uploadContainer = sender.get_element();
                    var editTable = uploadContainer.parentNode.parentNode.parentNode.parentNode;
                    var fileNameTextBox = editTable.rows[0].cells[1].getElementsByTagName('input')[0];
                                          
                    var str=args.get_fileInputField().title;;
                     
                    str = str.substring(str.lastIndexOf("\\") + 1);  
                    fileNameTextBox.value = str;  
                       
                }

 

Tags
Grid
Asked by
gc_0620
Top achievements
Rank 1
Answers by
gc_0620
Top achievements
Rank 1
Share this question
or