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

GridView Footer cell binding

5 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rajesh Kumar
Top achievements
Rank 1
Rajesh Kumar asked on 06 Jan 2010, 07:25 AM
Hi,

How can we bind the footer cells with a collection object? Let's assume that footer and normal rows uses different collection objects.

Regards,
Rajesh

5 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 08 Jan 2010, 01:29 PM
Hi Rajesh Kumar,

Using the FooterCellTemplate property of the column , you may place any custom content  in  the column footer - for example your own user control that gets data from a collection different from the aggregate results list for the owning column.

For example you may hook to the loaded event of such user control and feed it there with arbitrary data.

Greetings,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rajesh Kumar
Top achievements
Rank 1
answered on 08 Jan 2010, 01:34 PM
Hi Pavel,

Thank you for your reply. Can you please provide a sample for this?

Regards,
Rajesh
0
Pavel Pavlov
Telerik team
answered on 13 Jan 2010, 10:22 AM
Hello Rajesh Kumar,

I have tried to cover your scenario in the attached sample project. It has a RadGridView bound to a list of persons.  In the footer of the first row we display a different collection. For the purposes of the demo I have placed there a small listbox bound to a collection of numbers.You can replace the ListBox with any user control if you need to apply additional logic on the collection ( for example sum) .

Regards,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David
Top achievements
Rank 1
answered on 30 Mar 2010, 07:09 PM
Thanks for the example, what I am trying todo on the Footer is to have the same text alignment as the cell content, i.e. all monetry values need to align Right, what ever I try I can not get the Footer to get the right alignment, also when I change the size of the column the footer does not get updated with the new size.

Any help would be appreciated
0
Pavel Pavlov
Telerik team
answered on 01 Apr 2010, 03:35 PM
Hi David,

When using a custom footer template you can manually set the alignment desired.
For example in the project  from my previous post , you can control the footer content alignment by altering the XAMLe.g. the following way :

<telerik:GridViewDataColumn.Footer>
                        <ListBox Loaded="ListBox_Loaded" Background="Transparent"  HorizontalAlignment="Right" />
                    </telerik:GridViewDataColumn.Footer>


Regards,
Pavel Pavlov
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
Rajesh Kumar
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Rajesh Kumar
Top achievements
Rank 1
David
Top achievements
Rank 1
Share this question
or