I got it to work but it oddly took out my field that contained the website from the datagrid. Really I was just looking for other hyperlink methods to try to resolve my issue from my post http://forums.arcgis.com/threads/58727-Field-Hyperlink. If you could provide some assistance on my field hyperlink post I would greatly appreciate it. Right now I am just lost on what to do to get my identify layer selection in three datagrids to each have a hyperlink. Thanks for your help.
public string URLlink { get; set; } private void IdentifyDetailsDataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { try { string s = e.Row.DataContext.ToString(); if (s.Contains("http")) { string[] sSplit = s.Split(','); string[] link = sSplit[1].Split(']'); URLlink = link[0]; } else { } } catch { } } private void DTSButton_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri(URLlink), "_blank"); }
I think you just need to add reference to this .NET Assembly "System.Windows.Browser" and resolve reference to add using statement for this namespace http://msdn.microsoft.com/en-us/library/system.windows.browser.htmlpage%28v=vs.95%29.aspx
public string URLlink { get; set; } private void IdentifyDetailsDataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { string value = e.Row.DataContext.ToString(); if (value.Contains("http")) { //Hides URLLink data line from Datagrid Results SolidColorBrush brush = new SolidColorBrush(Colors.Transparent); e.Row.Foreground = brush; } else { } try { string s = e.Row.DataContext.ToString(); if (s.Contains("http")) { string[] sSplit = s.Split(','); string[] link = sSplit[1].Split(']'); URLlink = link[0]; } else { } } catch { } } private void DTSButton_Click(object sender, RoutedEventArgs e) { HtmlPage.Window.Navigate(new Uri(URLlink), "_blank"); }
<Button x:Name="DTSButton" Click="DTSButton_Click"/> <slData:DataGrid x:Name="IdentifyDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="None" Background="White" LoadingRow="IdentifyDetailsDataGrid_LoadingRow"> <slData:DataGrid.Columns> <slData:DataGridTextColumn Binding="{Binding Key}" FontWeight="Bold"/> <slData:DataGridTextColumn Binding="{Binding Value}" /> </slData:DataGrid.Columns> </slData:DataGrid>
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.