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

Disable or Hide Bad Hyperlink in Grid

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 03 Jun 2014, 04:16 PM
I have a grid with a hyperlink to a network folder.  The location is constructed in a query based on some information that SHOULD be correct, but there are mistakes made by the end-users and the hyperlink on occasion will be correct.  

<telerik:GridTemplateColumn ColumnGroupName="DLB" UniqueName="Location"  Display="True" HeaderText="Files" >
    <ItemTemplate>
        <a href="<%# Eval("Location")%>" target="_blank">Open folder</a>
    </ItemTemplate>
</telerik:GridTemplateColumn>

For each row, I would like to somehow handle that hyperlink if the network folder does not exist.  Either there will be no link to click or popup a message that informs the user the network folder does not exist.

I figure I would likely use System.IO.Directory.Exists, but I am clueless as to how to implement that.  I have made some attempts and searched for a solution, but have not come up with anything that works for me.

Thank you!

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Jun 2014, 02:45 PM
Hi Rick,

I am sending you a sample RadGrid web site to demonstrate the different ways of creating a Link column. You can also access the generated controls to change their navigation URL according to your custom preferences:
http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html

Hope this helps.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Rick
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or