Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
780
HyperLinkButton binding.
posted

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: 54
Char: 13
Code: 0
URI: file:///C:/InfoMod/Silverlight%20Examples/InfragisticsGridTest/Bin/Debug/TestPage.html

 

 

 

 

 


 

 

 

Parents
  • 105
    posted

    hi iam usig that piece of code for this

     

     HyperlinkColumn hlnkcol = new HyperlinkColumn();
                  hlnkcol.HeaderText = "CardCode";
                  hlnkcol.Key = propertyInfo.Name;
                  hlnkcol.ContentBinding = new Binding("CardCode");
                  hlnkcol.TargetName = "_blank";

    BaseXamGrid.Columns.Add(hlnkcol);

    my card code is c5000 it genrate same error but my card code is 5000 it run's perfectly i am using it's latest version 10.2 please help me regarding that

Reply Children