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

Hyperlink in Column Data Template Issues

2 Answers 335 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Betsy
Top achievements
Rank 1
Betsy asked on 31 Aug 2011, 06:14 PM
I'm using WPF 4.0, v2011.2.712.40.

I have a grid with two columns that have hyperlink controls in the datatemplate so I can launch to another view within my application when a user clicks on the link.  Periodically the hyperlinks do not trigger the command it is bound to.  If I refresh the list that the grid is bound to then the item with the issue will start to work but sometimes other items stop working.  Here is the column definition.  As you can see from the commented parts of the datatemplate I have also tried using a button but have issues there as well.  If I let the button (or radbutton) look like a regular button without styling it everything seems to work better but if I put a style on it to make it look like a link button the memory usage of my app increases dramatically as the grid is scrolled.

<telerik:GridViewDataColumn Header="Account" DataMemberBinding="{Binding AccountName}" FooterCellStyle="{StaticResource GridNoLinesFooterStyle}">
  <telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
      <!--<Button Content="{Binding AccountName}" Command="{Binding DataContext.OpenAccountCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" 
              CommandParameter="{Binding}"/>-->
      <!--<telerik:RadButton Content="{Binding AccountName}" Command="{Binding DataContext.OpenAccountCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" CommandParameter="{Binding}" 
                         Style="{StaticResource hyperlinkButtonStyle}" />-->
      <TextBlock>
          <Hyperlink Command="{Binding DataContext.OpenAccountCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" CommandParameter="{Binding}"
              <TextBlock Text="{Binding AccountName}"></TextBlock>
          </Hyperlink>
      </TextBlock>
    </DataTemplate>
  </telerik:GridViewDataColumn.CellTemplate>
  <telerik:GridViewBoundColumnBase.AggregateFunctions>
    <telerik:CountFunction Caption="Count:" />
  </telerik:GridViewBoundColumnBase.AggregateFunctions>
</telerik:GridViewDataColumn>

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 05 Sep 2011, 10:05 AM
Hi Heather,

I have tested the case, but unfortunately I was not able to reproduce the issue you reported. May you take a look at the sample to verify whether I am missing something ?
 

Kind regards,
Maya
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Betsy
Top achievements
Rank 1
answered on 12 Sep 2011, 04:13 PM
Unfortunately it is not on-demand reproducable.  It seems to occur most often when there is a large result set returned.  I know its not data related because I can refresh the datasource and the same item that didn't work before the refresh would work after the refresh and another item might not work.
Tags
GridView
Asked by
Betsy
Top achievements
Rank 1
Answers by
Maya
Telerik team
Betsy
Top achievements
Rank 1
Share this question
or