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

[Solved] GridViewHyperlinkColumn for Page Navigation

6 Answers 371 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
MegaVitaminD
Top achievements
Rank 1
MegaVitaminD asked on 10 Jun 2010, 07:04 PM
I'm not having much luck with the documentation and hope someone on here can help me out with a GridView problem.

I want to use the GridView for a Search screen. The 1st column in the grid will be the ID value for the record. I want to put a Hyperlink column so the user can click on the ID value and have the Silverlight app navigate to another page within the app that allows the user to work with that record.

The parameter passed with the link will be the ID value.

I was able to use this code to access an external link:

<

 

 

telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding ID}"

 

 

 

    NavigateUrlMemberPaths="TeamUrl"

 

 

 

    NavigateUrlFormatString="{} http://www.testapp.com/{0}"

 

 

 

    TargetName="_blank" />

However, I couldn't get this to direct me to a page within the current app.

Any ideas?

TIA

D


 

6 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 11 Jun 2010, 07:17 AM
Hi ,

So, where did it redirect you to?
What data does the TeamUrl property holds?

Kind regards,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
MegaVitaminD
Top achievements
Rank 1
answered on 11 Jun 2010, 02:32 PM

I'm sorry if I didn't ask my question clearly. In the documentation for the latest version of the Telerik Silverlight controls, it indicates that this should work:

 

 

 

 

<telerik:GridViewHyperlinkColumn Header="ID" DataMemberBinding="{Binding ID}" TargetName="/TestPage" />

 

 

 

 


If I use this, it gives me an unhandled error 404. something about the binding cannot be NULL.

What I need is an example of a GridViewHyperlinkColumn that directs me to an internal page within the app.

D

0
Accepted
Veselin Vasilev
Telerik team
answered on 15 Jun 2010, 02:32 PM
Hi,

I have attached a sample application here. Please download it and give it a go.
It uses the Silverlight Navigation project template. I added a gridview with dynamic hyperlink column which redirects to another page and show information about the clicked row.

Hope you find it useful.

Best wishes,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
MegaVitaminD
Top achievements
Rank 1
answered on 15 Jun 2010, 03:38 PM
That worked! Thanks a million!!

D
0
Edward
Top achievements
Rank 1
answered on 16 Feb 2011, 01:07 AM
Hi,

I have downloaded the sample app which works fine, but when I use the code in my app it opens a new browser window with a suffix added to the URL for the page name - like ordinary HTML navigation - instead of going to the different xaml page.

My code is:
<telerik:RadGridView Name="gridView2"  AutoGenerateColumns="False" ItemsSource="{Binding rowCollection, Source={StaticResource DocumentsSampleData}}" 
>
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Document_Name}"/>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Document_Description}"/>
                        <telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding DocumentID}"
                                                                TargetName="ContentFrame" 
                                                                NavigateUrlMemberPaths="DocumentID"
                                                                NavigateUrlFormatString="/DocumentContent/{0}"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

It is very perplexing becuase your project works and mine dosen't :-)

I checked the code behind and there didn't seem to be anything there that would cause this difference. Maybe it has to do with the project type?

Any assistance would be appreciated.

Thank you,

Edward
0
Vanya Pavlova
Telerik team
answered on 17 Feb 2011, 04:05 PM
Hi David,

From the code snippet provided you have missed to specify the following properties TargetName, NavigateUrlMemberPaths, NavigateUrlFormatString as it was shown in the previous example:

<telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding Email}"
                                                               TargetName="ContentFrame" 
                                                               NavigateUrlMemberPaths="Email"
                                                               NavigateUrlFormatString="/DetailsPage/{0}"/>


You can read more about these properties following this link.


Kind regards,
Vanya Pavlova
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
MegaVitaminD
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
MegaVitaminD
Top achievements
Rank 1
Edward
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or