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
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
0
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.
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
Thank you for your reply. Can you please provide a sample for this?
Regards,
Rajesh
0
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.
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
Any help would be appreciated
0
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 :
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.
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.