Select to view content in your preferred language

How to customize the identify attribute to make a clickable URL?

800
3
05-27-2010 10:45 AM
weiliang
Deactivated User
There is an attribute in one of our map layers that is actually a URL. How can I customize to make this attribute clickable and can navigate to this URL.

Thanks for your help!

Wei
0 Kudos
3 Replies
ScottFriedrich
Regular Contributor
Assuming you are using the DataGrid control to display the attributes, you can probably use DataGridTemplateColumn and bind the NavigateURL to your attribute.

Here is an example of using DataGridTemplateColumn :

http://blogs.msdn.com/b/scmorris/archive/2008/03/27/defining-columns-for-a-silverlight-datagrid.aspx

Hope this helps,

Scott
0 Kudos
dotMorten_esri
Esri Notable Contributor
Put a hyperlink in your maptip (assuming you have an attribute called "urlString" thats a string with the url:

<esri:GraphicsLayer>
  <esri:GraphicsLayer.MapTip>
    <Border Background="White" Padding="5" esri:GraphicsLayer.MapTipHideDelay="0:0:0.5">
      <HyperlinkButton Content="Click Here" NavigateUri="{Binding [urlString]}" />
    </Border>
  </esri:GraphicsLayer.MapTip>
</esri:GraphicsLayer>


Note binding expression will only work with Silverlight 4. If you are still using SL3, you will need to use the dictionary converter.
0 Kudos
weiliang
Deactivated User
Thanks for your kindly reply, both Morten Nielsen and Scott Friedrich. I will try that.

Best,

Wei
0 Kudos