Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

Dynamic Data Conditionally Display Foreign Key Links

I am working on a Dynamic Data site and I have two separate pages to view a table (one that allows add/update/delete and one that is read only).  I need a good way to remove foreign key links on one of the pages, but retain the functionality on the other.

Please only examples in VB.NET.  I tried to get this solution in C# to work, even converting it, with no luck, but this is basically what I'm going for:
http://csharpbits.notaclue.net/2009/01/allow-navigation-on-foreignkey.html
0
natek11
Asked:
natek11
1 Solution
 
natek11Author Commented:
This is how I got it to work, although I'm sure it's not the best way:
1. Created a custom version of the ForeignKey.ascx field template with a label instead of a link
2. Turned off autogeneratecolumns on the gridview of the read-only page
3. Manually added all the fields as asp:DynamicFields
4. Set the UIHint on the Foreign Key DynamicField to my custom field template

Still open to suggestions on a better method...
<asp:DynamicField DataField="Statement_Type" HeaderText="Statement Type" UIHint="ForeignKey_NoLink" />

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now