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

GrChange DridView Footer by BehindCode

4 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gerardo
Top achievements
Rank 1
Gerardo asked on 03 Jun 2011, 11:29 AM
Hello,
I´m adding columns into the grid through behindcode. I want to show group title but i dont want to show footer title, I´m try to do this in behindcode:

<telerik:GridViewDataColumn.Footer>
    <GridView:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center" Grid.Column="4">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <TextBlock VerticalAlignment="Center" Text="{Binding FormattedValue}" />
            </DataTemplate>
        </ItemsControl.ItemTemplate>                           
    </GridView:AggregateResultsList>
</telerik:GridViewDataColumn.Footer>



I do this but it doesn´t work:

var bindingFooter = new Binding { Path = new PropertyPath("FormattedValue") };
var frameworkElementFactoryFooter = new FrameworkElementFactory(typeof(TextBlock));
frameworkElementFactoryFooter.SetBinding(TextBlock.TextProperty, bindingFooter);
frameworkElementFactoryFooter.SetValue(FrameworkElement.HorizontalAlignmentProperty, HorizontalAlignment.Right);

var dataTemplateFooter = new DataTemplate { VisualTree = frameworkElementFactoryFooter };

dataTemplateFooter.Seal();

var itemControl = new ItemsControl() { ItemTemplate = dataTemplateFooter };

 

var listaAgregada = new AggregateResultsList();
listaAgregada.Items.Add(itemControl);
gridViewDataColumn.Footer = listaAgregada;



Thanks

 

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 03 Jun 2011, 11:56 AM
Hello Gerardo,

 

In such case it would be more appropriate to dynamically build your column footers similar to our online Totals demo. Just keep the corresponding Footer as a Resource within UserControl's Resource Collection and reference it in code-behind. 

Kind regards,
Vanya Pavlova
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
Gerardo
Top achievements
Rank 1
answered on 06 Jun 2011, 07:33 AM
Hello,
I can´t see that demo, because it doesn´t load. it stops at 20%.
0
Milan
Telerik team
answered on 06 Jun 2011, 08:07 AM
Hi Gerardo,

Please, try to clear your Click-once cache by executing the following command:

mage -cc

Hope this helps.


All the best,
Milan
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
Gerardo
Top achievements
Rank 1
answered on 06 Jun 2011, 09:23 PM
Hello,
I don´t know how i do this:
"Just keep the corresponding Footer as a Resource within UserControl's Resource Collection and reference it in code-behind"

Thanks, for your support
Tags
GridView
Asked by
Gerardo
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Gerardo
Top achievements
Rank 1
Milan
Telerik team
Share this question
or