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

Question about GroupHeaderTemplate

3 Answers 285 Views
GridView
This is a migrated thread and some comments may be shown as answers.
james
Top achievements
Rank 1
james asked on 05 Jul 2010, 05:52 PM
When I set the HyperLink Button into the <telerik:RadGridView.GroupHeaderTemplate> to display the Customer No and click the HyperLink Button,  I couldn't get the Customer ID from this event.   The code is as below:

<telerik:RadGridView.GroupDescriptors> 
             <telerik:GroupDescriptor Member="CustomerNo"
                    <telerik:GroupDescriptor.AggregateFunctions> 
                        <telerikData:MaxFunction SourceField="CustomerName" Caption="Customer Name:"/> 
                    </telerik:GroupDescriptor.AggregateFunctions> 
              </telerik:GroupDescriptor> 
 </telerik:RadGridView.GroupDescriptors> 
<telerik:RadGridView.GroupHeaderTemplate> 
             <DataTemplate> 
                    <HyperlinkButton Content="{Binding Header}" commands:Click.Command="{Binding Path=Value, Source={StaticResource ViewCustomerProfileCommand}}". commands:Click.CommandParameter="{Binding CustomerID}"/> 
              </DataTemplate> 
  </telerik:RadGridView.GroupHeaderTemplate> 

I think the method that is to set the CustomerID into the Command Parameter is wrong. However,  I don't know how to set the value of Customer ID.  Please give me some help and provide the sample code. Thanks so much.

By the way, the text of "Grouped by" wasn't displayed in the screen. There is a text of "Grouped by Country" in the "Grouping and Aggregates" in the page http://www.telerik.com/products/silverlight/gridview.aspx, which I want to achieve the feature. Unfortunately, the text of "Grouped by Customer No" have not achieved basing on above code.

Please do me a favor. Thanks so much again.



3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Jul 2010, 06:16 AM
Hi,

 The group header DataContext is actually Telerik.Windows.Controls.GridView.GroupViewModel - you can use bindings to this class properties. 

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
0
james
Top achievements
Rank 1
answered on 06 Jul 2010, 04:16 PM
Thanks for your help. However,  could you help me to resolve the second question? The text of "Grouped by" wasn't displayed in the screen. There is a text of "Grouped by Country" in the "Grouping and Aggregates" of the page http://www.telerik.com/products/silverlight/gridview.aspx, which I want to achieve the feature. Unfortunately, the text of "Grouped by Customer No" have not achieved basing on above code.

Please do me a favor. Thanks so much.
0
Vlad
Telerik team
answered on 07 Jul 2010, 06:41 AM
Hi,

 Do you have our latest version? You can check this demo for more info about the latest grid behavior when grouping. 

Kind regards,
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
Tags
GridView
Asked by
james
Top achievements
Rank 1
Answers by
Vlad
Telerik team
james
Top achievements
Rank 1
Share this question
or