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

HyperLink in Totals?

1 Answer 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Terry Newton
Top achievements
Rank 1
Terry Newton asked on 29 Mar 2011, 10:37 PM
I have a grid that I have used a CellTemplate and a datatemplate with a HyperlinkButton whose content is bound to the property for the column to accomplish a hot link to impliment a drill down from the Grid.  So far so good, but when I go to accomplish the same using the totals row I do not seem to be able to template it in order to control the content.

How can I turn my total row into something I can handle a click event on?

Any suggestions?

Some code is shown below as reference, but not all, for clarity

 

 

 

<tkGrid:GridViewDataColumn

 

 

 

 

UniqueName="Scheduled"

 

 

 

 

HeaderCellStyle="{StaticResource GridViewHeaderCellStyle}"

 

 

 

 

FooterCellStyle="{StaticResource GridViewFooter_CellStyle}"

 

 

 

DataMemberBinding="{Binding Scheduled}">

 

 

 

 

<tkGrid:GridViewDataColumn.Header>

 

 

 

 

<TextBlock Text="Scheduled Assignments" TextWrapping="Wrap" />

 

 

 

 

</tkGrid:GridViewDataColumn.Header>

 

 

 

 

<tkGrid:GridViewDataColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<HyperlinkButton

 

 

 

 

x:Name="Scheduled"

 

 

 

 

ToolTipService.ToolTip="{Binding Scheduled}"

 

 

 

 

Content="{Binding Scheduled}"

 

 

 

 

Tag="{Binding EmployeeID}"

 

 

 

Click="HyperlinkButton_Click"

 

 

 

 

Style="{StaticResource UnderlinedHyperlinkButton}"

 

 

 

 

ClickMode="Press"

 

 

 

 

</HyperlinkButton >

 

 

 

 

</DataTemplate>

 

 

 

 

</tkGrid:GridViewDataColumn.CellTemplate>

 

 

 

 

<tkGrid:GridViewColumn.AggregateFunctions>

 

 

 

 

 

<tkData:CountFunction ResultFormatString="{}{0} " />

 

 

 

 

</tkGrid:GridViewColumn.AggregateFunctions>

 

 

 

 

</tkGrid:GridViewDataColumn>

 

 

 

Private Sub HyperlinkButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)

 

 

miEmployeeID = sender.tag

 

 

 

Select Case DirectCast(sender, System.Windows.Controls.HyperlinkButton).Name

 

 

 

Case "Scheduled"

 

 

 

Dim odlgScheduled As New dlg_Scheduled(miEmployeeID)

 

odlgScheduled.ShowDialog()

 

 

End Select

 

 

 

End Sub

 

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 30 Mar 2011, 02:30 PM
Hello Terry,

 
Once you predefined either the Footer of GroupFooterTemplate of a GridViewColumn (as it is shown in our Totals demo} you can place anything you need there, please refer to the markup below:

<telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding Property1}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="Total:"/>
                        </telerik:GridViewDataColumn.AggregateFunctions>
                    <telerik:GridViewDataColumn.Footer>
                       <StackPanel Orientation="Vertical">
                                <TextBlock Text="Some Text"/>
                                <telerik:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock VerticalAlignment="Center" Text="{Binding FormattedValue}"/>
                                                <HyperlinkButton x:Name="hbtnTest" TargetName="_blank" Content="RadGridView/Silverlight" NavigateUri="http://www.telerik.com"/>
                                               <telerik:RadButton Content="{Binding Caption}" Click="RadButton_Click"/>
                                        </StackPanel>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Vertical"/>
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </telerik:AggregateResultsList>
                            </StackPanel>
                     </telerik:GridViewDataColumn.Footer>
                </telerik:GridViewDataColumn>



Greetings,
Vanya Pavlova
the Telerik team
Tags
GridView
Asked by
Terry Newton
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or