<
telerikGridView:GridViewColumn Width="*">
<telerikGridView:GridViewColumn.CellStyle>
<Style TargetType="GridView:GridViewCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GridView:GridViewCell">
<Border BorderThickness="0,0,0,1" BorderBrush="#FFB3B3B3">
<HyperlinkButton x:Name="ViewDetailsButton" Content="View Details" NavigateUri="http://www.myurl.com/page.aspx?id={Binding Id}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerikGridView:GridViewColumn.CellStyle>
</telerikGridView:GridViewColumn>
Chris Buchanan
iomer Internet Solutions Inc.
12 Answers, 1 is accepted
<HyperlinkButton x:Name="ViewDetailsButton" Content="View Details" NavigateUri="{Binding Id, Converter={StaticResource UriConverter}}" />
And in your converter, you put something like
return "http://www.myurl.com/page.aspx?id="+value.toString();
In our latest internal build we introduced two new columns: GridViewHyperlinkColumn and GridViewDynamicHyperlinkColumn. Here is an example for both columns:
...
<telerik:GridViewHyperlinkColumn DataMemberBinding="{Binding Url}" ContentBinding="{Binding CompanyName}" />
...
<telerik:GridViewDynamicHyperlinkColumn DataFormatString="Send mail to: {0}"
DataMemberBinding="{Binding CompanyName}"
NavigateUrlMemberPaths="ContactName, CompanyName"
NavigateUrlFormatString="mailto:{0}@{1}.com"/>
or
<telerik:GridViewDynamicHyperlinkColumn DataMemberBinding="{Binding MyProperty1}"
TargetName="_blank"
NavigateUrlMemberPaths="MyProperty2, MyProperty3"
NavigateUrlFormatString="http://www.myurl.com/page.aspx?q1={0}&q2={1}"/>
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You can download our latest internal build even now:
http://www.telerik.com/account/latest-internal-builds.aspx
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Could you please explain how to programmatically add one GridViewHyperlinkColumn and one GridViewDynamicHyperlinkColumn to a RadGridView?
Thank you,
Axel
There are no difference compared to other grid columns. All you need is to create the column, set desired properties and add the column in the Columns collection.
Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
they seems to have changed for DataMemberBinding, ContentBinding and DataFormatBinding
when I click on the email
Here's my code
GridViewHyperlinkColumn gvhc = new GridViewHyperlinkColumn(); |
gvhc.DataMemberBinding = new System.Windows.Data.Binding() { Path = new PropertyPath(BindingPath) }; |
gvhc.ContentBinding = new System.Windows.Data.Binding() { Path = new PropertyPath(BindingPath) }; |
gvhc.DataFormatString = "mailto:{0}"; |
I also tried with "{}{mailto:{0}" with no luck
I tried "{}{0}" still no luck
For your information, the real value is a complete email like joe@company.com
Please use GridViewDynamicHyperlinkColumn instead - I've attached an example project.
Best wishes,
Vlad
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.
So if I understand, GridViewDynamicHyperlinkColumn is used for hyperlinks and emails so what is the other for ?
Are these details found in the help somewhere ?
GridViewHyperlinkColumn will bind ContentProperty and NavigateUriProperty to the generated HyperlinkButton however GridViewDynamicHyperlinkColumn will construct Uri on the fly and will assign this Uri to NavigateUri of the generated HyperlinkButton directly.
Your actual data (joe@company.com) is not valid Uri - if this was mailto:joe@company.com GridViewHyperlinkColumn will work as well. In Silverlight 4 you can set StringFormat for your DataMemberBinding and this will affect the Uri.
Greetings,
Vlad
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.