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

Group Aggregated Functions Caption

3 Answers 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Boots
Top achievements
Rank 1
Boots asked on 06 Aug 2009, 03:47 PM
Hello,
I'm having troubles with the aggregate functions. On the examples that I have found when you group a column the collapsed row has whatever caption is on the GroupFooters and they seem to be left justified.
on the one I'm working with they display but they seem to be pushed to the right. I can't seem to find a way to position them to the left.

<telerik:RadGridView   
                Name="rgv"    
                Grid.Row="1"   
                Margin="10,5,10,5" 
                telerik:StyleManager.Theme="Office_Blue"   
                ShowColumnFooters="True"   
                ShowGroupFooters="True" 
                IsReadOnly="True"   
                AutoGenerateColumns="False" 
                ColumnsWidthMode="Auto" 
                ItemsSource="{Binding Source={StaticResource DataProvider}}">  
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn Header="ID" DataMemberPath="ID"  > 
                        <telerik:GridViewColumn.AggregateFunctions> 
                            <telerik:CountFunction Caption="Count:" /> 
                        </telerik:GridViewColumn.AggregateFunctions> 
                    </telerik:GridViewDataColumn> 
                    <telerik:GridViewDataColumn Header="Desc" DataMemberPath="Desc"  /> 
                    <telerik:GridViewDataColumn Header="Purchase Date" DataMemberPath="Purch_Date"  DataFormatString="{}{d}" /> 
                    <telerik:GridViewDataColumn Header="Purchase Price" DataMemberPath="Purch_Price" DataFormatString="{}{0:c}" > 
                        <telerik:GridViewColumn.AggregateFunctions> 
                            <telerik:SumFunction Caption="Sum:" ResultFormatString="{}{0:c}" SourceField="Purch_Price" /> 
                        </telerik:GridViewColumn.AggregateFunctions> 
                    </telerik:GridViewDataColumn> 
                    <telerik:GridViewDataColumn Header="Disposal Date" DataMemberPath="Disp_Date" DataFormatString="{}{d}" /> 
                    <telerik:GridViewDataColumn Header="Disposal Price" DataMemberPath="Disp_Price" > 
                        <telerik:GridViewColumn.AggregateFunctions> 
                            <telerik:SumFunction Caption="Disp Sum:" ResultFormatString="{}{0:c}" SourceField="Disp_Price" /> 
                        </telerik:GridViewColumn.AggregateFunctions> 
                    </telerik:GridViewDataColumn> 
                    <telerik:GridViewDataColumn Header="Type" DataMemberPath="Type" /> 
                    <telerik:GridViewDataColumn Header="Tax" DataMemberPath="Tax" /> 
                    <telerik:GridViewDataColumn Header="Status" DataMemberPath="Status" /> 
                    <telerik:GridViewDataColumn Header="Property Type" DataMemberPath="Property_Type" /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 

After grouping the type column i get somthing like
1503                                                           |  Count: 56                        |  Sum: $1,978.1     and the rest is cut off

Thanks much,
~Boots

3 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 12 Aug 2009, 10:46 AM
Hello Boots,

The way to accomplish this is via editing the template of the group row and set the horizontal alignment to left. Right now however there is a bug with editing the group row style and we are working hard on providing a fix as soon as we can. Unfortunately this will prevent aligning of the aggregates to the left until this bug is fixed.

I apologize for the inconvenience caused. Please monitor our latest internal builds for this fix.

Best wishes,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Boots
Top achievements
Rank 1
answered on 12 Aug 2009, 01:14 PM
Kalin,

Thanks for the response. I'll keep an eye out for that. I was wondering if you could give me a hand with something else I'm having trouble with. I'm trying to change the text color of the RadGridView. I assumed it would be Foreground="myColor" but nothing happened. So I tried the same with GridViewRow and GridViewCell, but nothing still. 

Thanks Again,
~Boots
0
Missing User
answered on 14 Aug 2009, 02:28 PM
Hi Boots,

There is a known issue in our SP1 with setting the Foreground directly in RadGridView.
But it should work properly if you use a style for the GridViewRow or GridViewCell and set the Foreground property in it like this:

<Style TargetType="telerik:GridViewRow">  
      <Setter Property="Foreground" Value="Blue"/>  
</Style> 
<Style TargetType="telerik:GridViewCell" > 
       <Setter Property="Foreground" Value="Red"/>  
</Style> 

However please keep in mind that the CellStyle will override the RowStyle.
I'm also attaching a small sample application for your convenience.

Sincerely yours,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Boots
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Boots
Top achievements
Rank 1
Missing User
Share this question
or