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

Access File Share from Hyperlink Column

3 Answers 156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 10 May 2010, 01:12 AM
Hi all (and thanks in advnace for your help),

I have a hyperlink set as follows:
<asp:HyperLink  
ID="HyperLink1" 
runat="server" 
NavigateUrl = "\\server\share\SomeDoc.doc>  
</asp:HyperLink> 
This works fine & is what the client wants. It opens the file "SomeDoc.doc" in MS Word.

Now the question. I have a table as follows:
"John""\\server\share\John.doc" 
"Mary""\\server\share\Mary.doc" 
etc...
 

I would like to use th RadGrid control with a HyperLink column so that the NavigateUrl is set to the UNC Path of the file in the table so when the user clicks the Hyperlink, the file "\\server\share\John.doc" opens up in MS Word.

I am have difficulty doing this.

Any ideas would be greatly appreciated.

Thanks, Kevin

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 May 2010, 09:19 AM
Hi Kevin,

Try the following setting with GridHyperLinkColumn in order to accomplish the same.

aspx:
         
        <Columns > 
            <telerik:GridHyperLinkColumn   
                     DataNavigateUrlFields="Name"
                     DataTextFormatString="Open {0}"  
                     UniqueName="Name"  
                     DataNavigateUrlFormatString="\\server\share\{0}.doc"  
                     DataTextField="Name">     
             </telerik:GridHyperLinkColumn>      
        </Columns> 

Hope this helps,
Princy.
0
Kevin
Top achievements
Rank 1
answered on 10 May 2010, 12:59 PM
Princy,

Thanks you, thank you, thank you !!!

My head no longer hurts from banging it against the wall.

One other question:

How do I dynamically set these valuses when the grid is being loaded?

Thanks again, Kevin
0
Princy
Top achievements
Rank 2
answered on 17 May 2010, 02:11 PM
Hello Kevin,

If you want to set the column properties dynamically, then you could access the column using "ColumnUniqueName" and set the property. Checkout the "Declarative columns" part in the following documentation.
Using columns

Thanks,
Princy.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Share this question
or