This is a migrated thread and some comments may be shown as answers.

GridViewDynamicHyperlinkColumn thorws error for null values

0 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Yamuna
Top achievements
Rank 1
Yamuna asked on 04 Dec 2011, 11:07 PM
I am using GridViewDynamicHyperlinkColumn to display file paths as links in a gridview.this is my code for that column:
<telerik:GridViewDynamicHyperlinkColumn Header="Result File" IsReadOnly="True" DataMemberBinding="{Binding ResultFile , Converter={StaticResource ConvertNullString}, ConverterParameter=Open|N/A}" NavigateUrlFormatString="\{0}" NavigateUrlMemberPaths="ResultFile" TargetName="_blank"/>

The ResultFile returns full path to file if any exists and NULL else. ConvertNullString change the display string to 'Open' if it is not null and to 'N/A' in case of NULL.
When I click on the link 'N/A' (when value is null ) it throws below js error.

Microsoft JScript runtime error: Unhandled Error in Silverlight Application Cannot navigate to locations relative to a page.   at MS.Internal.NavigationHelper.GetAbsoluteUri()

   at MS.Internal.NavigationHelper.Navigate(Boolean checkUserInitiatedAction)

   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, Int32 actualArgsTypeIndex, String eventName)

How can I avoid this error? I need to make the link either non-clickable or to do nothing when click for Null values. I tried using Converter for NavigateUrlFormatString  and NavigateUrlMemberPaths. But it did'nt  work for me. Please help with a solution.

Thanks.

 

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Yamuna
Top achievements
Rank 1
Share this question
or