Select to view content in your preferred language

Would like to selectively generate hyperlinks in my identify window

562
1
08-24-2011 11:18 AM
DanielSchatt
Regular Contributor
Well I finally figured out how to make hyperlinks out of the values in in my Identify window.  The problem now is that it's generating them for every value of every field in every layer, but only one field of one layer should have them.  Below is my code and I've commented out the original line of code that made the regular text display so now everything is hyperlinks:

     <slData:DataGrid x:Name="IdentifyDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="None" Background="White">
      <slData:DataGrid.Columns>

                                                        <!-- These are the field names -->
       <slData:DataGridTextColumn Binding="{Binding Key}" FontWeight="Bold"/>
       
       <!-- These are the values as regular text elements. -->
       <!--<slData:DataGridTextColumn Binding="{Binding Value}"/>-->
      
       <!-- These are the values as hyperlink text elements. -->  
       <slData:DataGridTemplateColumn>
        <slData:DataGridTemplateColumn.CellTemplate>
                                      <DataTemplate>
                                        <HyperlinkButton NavigateUri="{Binding Value, StringFormat=http://ccrm.vims.edu/permits/\{0\}.pdf}" Content="{Binding Value}" VerticalContentAlignment="Center" TargetName="_blank"/>                    
           </DataTemplate>        
        </slData:DataGridTemplateColumn.CellTemplate>
       </slData:DataGridTemplateColumn>
      
      </slData:DataGrid.Columns>
     </slData:DataGrid>

So the code is there but I just need to set up a simple conditional statement in XAML, like an if-then, based on the Value, such that if the Value string has particular characteristics it would appear as a hyperlink, otherwise regular text...or else change this based on the value of its corresponding field name (the Key string)...is this possible?  Thanks much for any help!

Dan
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
You can probably do something similar to this: http://forums.silverlight.net/p/84984/519530.aspx. In this Silverlight forum, they use a converter to update the CellTemplate based on the value. http://forums.silverlight.net/p/63345/157355.aspx
0 Kudos