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

[Solved] GroupFooter Problem about Binding property

3 Answers 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ADEMIR BELIN
Top achievements
Rank 1
ADEMIR BELIN asked on 01 Mar 2010, 08:24 PM
Hi everyone,

At moment i'm working with the telerikGridView and I have a little problem in relation to the GroupFooter by Binding property.
I can´t  show  the real value of my property inherited of Funcionario class. I think thats problem is a Mistake myself into the code.

The Property Cli_Tot_SldDev is child of Funcionario class. When I use the property Binding of TextBlock Control, the Result doesn´t show in the MainPage. But, if I Insert the Value manually into the property Text="Value", it's show correctly in the MainPage.


 <telerikGridView:GridViewImageColumn.Footer > 
                      <Grid HorizontalAlignment="Center">  
                        <Grid.ColumnDefinitions> 
                          <ColumnDefinition Width="Auto" /> 
                          <ColumnDefinition /> 
                        </Grid.ColumnDefinitions> 
                        <!--<TextBlock Text="0" VerticalAlignment="Center" TextWrapping="Wrap" FontWeight="Bold" Foreground="#FF1F46F6" Grid.Column="1" />--> 
                        <TextBlock Text="{Binding Cli_Tot_SldDev}" VerticalAlignment="Center" TextWrapping="Wrap" FontWeight="Bold" Foreground="#FF1F46F6" Grid.Column="0" /> 
                      </Grid> 
                    </telerikGridView:GridViewImageColumn.Footer> 



Please, I need your help ASAP.

Tnks.

              <telerikGridView:RadGridView  x:Name="RadGridViewCli" Grid.Row="1" CanUserFreezeColumns="False"  AutoGenerateColumns="False" ItemsSource="{Binding Cliente}"  IsReadOnly="True" RowIndicatorVisibility="Collapsed" controls:StyleManager.Theme="Office_Black"  ShowColumnFooters="True" ShowGroupFooters="True" Exporting="RadGridViewCli_Exporting">  
                <telerikGridView:RadGridView.Columns> 
                  <telerikGridView:GridViewToggleRowDetailsColumn CellStyle="{StaticResource StretchedCellStyle}" /> 
                  <telerikGridView:GridViewDataColumn DataMemberBinding="{Binding Cli_Nome}" Header="Clientes" > 
                    <telerikGridView:GridViewDataColumn.AggregateFunctions> 
                      <telerikData:CountFunction Caption="Total Clientes: "/>  
                    </telerikGridView:GridViewDataColumn.AggregateFunctions> 
                  </telerikGridView:GridViewDataColumn> 
                  <telerikGridView:GridViewImageColumn DataMemberBinding="{Binding Cli_SaldoDevedor}"  Header="Sldo Dev. AD" ImageStretch="None" > 
 
                    <telerikGridView:GridViewImageColumn.Footer > 
                      <Grid HorizontalAlignment="Center">  
                        <Grid.ColumnDefinitions> 
                          <ColumnDefinition Width="Auto" /> 
                          <ColumnDefinition /> 
                        </Grid.ColumnDefinitions> 
                        <!--<TextBlock Text="0" VerticalAlignment="Center" TextWrapping="Wrap" FontWeight="Bold" Foreground="#FF1F46F6" Grid.Column="1" />--> 
                        <TextBlock Text="{Binding Cli_Tot_SldDev}" VerticalAlignment="Center" TextWrapping="Wrap" FontWeight="Bold" Foreground="#FF1F46F6" Grid.Column="0" /> 
                      </Grid> 
                    </telerikGridView:GridViewImageColumn.Footer> 
 

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 03 Mar 2010, 12:57 PM
Hi ADEMIR BELIN,

Where is this instance of the Funcionario class? You can bind things to properties of their DataContext. For example, if your grid is bound to a List<Funcionario> each normal row shows all the properties of the respective Funcionario instance as its cells. There is a grid row for every instance of Funcionario in the data source. The footer row is one and only and its DataContext is not an instance of the Funcionario class.

What are your trying to achieve? Please, send us a working sample/dummy project and tell us what exactly are you trying to do.

Regards,
Ross
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
ADEMIR BELIN
Top achievements
Rank 1
answered on 03 Mar 2010, 03:02 PM
Hi Ross,
I would like to show into the footer a calculated result, where I will sum some fields with all client that there is status equal False for example.
I'm using Hierarchy of  GridView silverlight RadControl, and this footer there is into the GridView Child.

I have a  Funcionario Class, where there is some Properties, as Cliente property(list of Clientes), as Totais_Func(List of Totais_Func).
The footer is into the GridView Child, where is Binding by Cliente property. And its footer would have my Calculate result by Totais_Func Property. But when the main page is loaded, the footer is Empty.

Funcionario class
    property 1 as  type
    property 2 as type
    property Cliente as (List of Cliente)
    property Totais_Func as (List of Totais Func)

- Hierarchy RadGridView
Funcionario RadGridView(Parent)
    Cliente RadGridView(Child - Property Cliente)
        Footer(Child - Property Totais_Func)

I trying show the calculate property by Totais_Func, into the footer of  Cliente RadGridView.
 


Regards,
Ademir Belin
0
Rossen Hristov
Telerik team
answered on 03 Mar 2010, 03:47 PM
Hi ADEMIR BELIN,

Now I see what you mean.

However, the way that you are trying to accomplish this is incorrect.

This might be possible if you create a custom aggregate function that will somehow use the one that you have and add this custom aggregate function to the column.

Here is our online example about Custom Aggregate Functions. Give it a try. I hope this helps.

Sincerely yours,
Ross
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
ADEMIR BELIN
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
ADEMIR BELIN
Top achievements
Rank 1
Share this question
or