<telerikGridView:GridViewDynamicHyperlinkColumn TargetName="_blank" SortMemberPath="TrackingNumber.TrackingNumberString" NavigateUrlFormatString="{Binding TrackingNumber.Courier.TrackingURL}" NavigateUrlMemberPaths="TrackingNumber.TrackingNumberString" DataMemberBinding="{Binding TrackingNumber.TrackingNumberString}" Header="Tracking Number" />
7 Answers, 1 is accepted
Could you please share the values of a typical record? I would like to see how the following properties look like:
- TrackingNumber.TrackingNumberString
- TrackingNumber.Courier.TrackingURL
Yavor Georgiev
the Telerik team
Below are the values.
- TrackingNumber.TrackingNumberString =
- Fedex 830271123988
- UPS 1Z 8A5 E94 03 4210 396 2
- TrackingNumber.Courier.TrackingURL =
- USPS http://trkcnfrm1.smi.usps.com/netdata-cgi/db2www/cbd_243.d2w/output?CAMEFROM=OK&strOrigTrackNum={0}
- UPS http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1={0}&track.x=0&track.y=0
- FedEx http://fedex.com/Tracking?action=track&tracknumber_list={0}&cntry_code=us
The error is a run time error which I have below.
Set property 'Telerik.Windows.Controls.GridViewDynamicHyperlinkColumn.NavigateUrlFormatString' threw an exception. [Line: 2537 Position: 206]
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: Set property 'Telerik.Windows.Controls.GridViewDynamicHyperlinkColumn.NavigateUrlFormatString' threw an exception. [Line: 2537 Position: 206] ---> System.ArgumentException: Object of type 'System.Windows.Data.Binding' cannot be converted to type 'System.String'.
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at MS.Internal.XamlMemberInfo.SetValue(Object target, Object value)
at MS.Internal.XamlManagedRuntimeRPInvokes.SetValue(XamlTypeToken inType, XamlQualifiedObject& inObj, XamlPropertyToken inProperty, XamlQualifiedObject& inValue)
--- End of inner exception stack trace ---
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
at System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.GetElementRoot(Boolean templatesAreGenerated)
at System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.Load()
at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
at System.Windows.Controls.ItemsControl.AddVisualChild(Int32 containerIndex, DependencyObject container, Boolean needPrepareContainer)
at System.Windows.Controls.ItemsControl.AddContainers()
at System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)
Line: 56
Char: 13
Code: 0
URI: http://localhost:4681/ASGWarehouse.aspx
Hope this helps :)
Unfortunately, the way the DynamicHyperlink column works won't help you in your scenario. You can't have a varying format string. NavigateUrlFormatString is not event a Dependency Property.
What you can do to make your scenario work is use a regular Hyperlink column and apply a binding converter. You'll need to build the Uri in that binding converter and return it.
Please let me know if you need further assistance in this.
Yavor Georgiev
the Telerik team
Thanks again!
I'm attaching a sample project.
Don't hesitate to contact me again if something comes up.
Yavor Georgiev
the Telerik team
Thanks. :) Your appreciation means a lot to us.
Sincerely yours,Yavor Georgiev
the Telerik team