This question is locked. New answers and comments are not allowed.
Hello,
I am creating a Hyperlink control inside a column. I have followed your example and I am seeing some stange results.
In my code I am unable change the Row focus by clicking on the column with the hyperlink. (well rather clicking the hyperlink, if I click outside the hyperlink but still inside the cell, it will change focus, and I assume it is because it doesn't pass on the Mouse event args but instead handles them)
I also notice that simply click on the hyperlink will not make it navigate to the Uri if that cell doesn't have focus, instead I must click to select the cell, then click again to navigate. This is not the case in your example, and I am unsure what I am doing differently.
Here is a simplified code chunk with demonstrates these 2 issues:
Here is the XAML:
Here is the code behind:
I have tried defining the Hyperlink column template several ways, but they all seem to result in these 2 issues.
Could you please advise me what I am doing wrong?
I am creating a Hyperlink control inside a column. I have followed your example and I am seeing some stange results.
In my code I am unable change the Row focus by clicking on the column with the hyperlink. (well rather clicking the hyperlink, if I click outside the hyperlink but still inside the cell, it will change focus, and I assume it is because it doesn't pass on the Mouse event args but instead handles them)
I also notice that simply click on the hyperlink will not make it navigate to the Uri if that cell doesn't have focus, instead I must click to select the cell, then click again to navigate. This is not the case in your example, and I am unsure what I am doing differently.
Here is a simplified code chunk with demonstrates these 2 issues:
Here is the XAML:
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:local="clr-namespace:Silver.App" |
| xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"> |
| <Grid> |
| <Controls:RadGridView x:Name="RadGridView1" IsReadOnly="True" AutoGenerateColumns="False"> |
| <Controls:RadGridView.Columns> |
| <Controls:GridViewDataColumn HeaderText="T0" /> |
| <Controls:GridViewDataColumn HeaderText="T1" /> |
| <Controls:GridViewDataColumn HeaderText="T2" /> |
| <Controls:GridViewDataColumn Width="550" HeaderText="Product (Template)" DataMemberPath="Name"> |
| <Controls:GridViewDataColumn.CellStyle> |
| <Style TargetType="telerikGridView:GridViewCell"> |
| <Setter Property="Template"> |
| <Setter.Value> |
| <ControlTemplate TargetType="telerikGridView:GridViewCell"> |
| <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> |
| <HyperlinkButton Content="Google" TargetName="_blank" NavigateUri="http://www.google.com" /> |
| </Border> |
| </ControlTemplate> |
| </Setter.Value> |
| </Setter> |
| <Setter Property="BorderThickness" Value="0,0,1,1"/> |
| </Style> |
| </Controls:GridViewDataColumn.CellStyle> |
| </Controls:GridViewDataColumn> |
| <Controls:GridViewDataColumn HeaderText="T3" /> |
| <Controls:GridViewDataColumn HeaderText="T4" /> |
| <Controls:GridViewDataColumn HeaderText="T5" /> |
| </Controls:RadGridView.Columns> |
| </Controls:RadGridView> |
| </Grid> |
Here is the code behind:
| public TestPage() |
| { |
| InitializeComponent(); |
| List<string> data = new List<string>() { "TEST0", "TEST1", "TEST2", "TEST3", "TEST4", "TEST5", "TEST6", "TEST7" }; |
| this.RadGridView1.ItemsSource = data; |
| } |
I have tried defining the Hyperlink column template several ways, but they all seem to result in these 2 issues.
Could you please advise me what I am doing wrong?
