How do I bind the navigate url for a HyperlinkColumn? I want to basically accomplish this in the cell:
<HyperlinkButton Content="Product Name" NavigateUri=http://mysite.com/product.aspx?ID=1 TargetName="_blank" />With the content bound to my product class Name field and the navigate uri coming from its Url field. I just can't find where to set the navigate uri. I tried this and the URI showed up as the text.
<
igDataGrid:HyperlinkColumn Key="Name" ContentBinding="{Binding Url}" TargetName="_blank" />
The Url showed as the text, and then clicking it gives theexception below (I assume because it's trying to navigate to "" since I haven't set it). I'm sure I'm missing something easy here, but can't see how to set the navigate uri.
Thanks,Keith
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; MS-RTC LM 8; FDM)Timestamp: Sun, 2 Aug 2009 23:57:40 UTC
Message: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.NotSupportedException: Cannot navigate to locations relative to a page. at System.Windows.Controls.HyperlinkButton.GetAbsoluteUri() at System.Windows.Controls.HyperlinkButton.Navigate() at System.Windows.Controls.HyperlinkButton.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
Line: 54Char: 13Code: 0URI: file:///C:/InfoMod/Silverlight%20Examples/InfragisticsGridTest/Bin/Debug/TestPage.html
Hi Keith,
The Key you're using for the HyperlinkColumn, must map to an actual URI or a string representation of a URI in your datasource. To customize the Text of what gets displayed to the end user, you can use the Content property, if the field should be the same for every row, or the ContentBinding property to map to another property on your object.
Hope this helps clear some things up.
-SteveZ
Yup, that makes sense. Thanks Stephen.