This question is locked. New answers and comments are not allowed.

Craig Corbin
Top achievements
Rank 1
Craig Corbin
asked on 22 Nov 2010, 10:45 PM
I have a GridView which displays a SumFunction in a FooterCell. I would like to make the background of the cell red, if the sum is greater that 1.0.
Here is the working code for this particular column...(With the exception of any code which attempts to apply style.)
Craig
Here is the working code for this particular column...(With the exception of any code which attempts to apply style.)
<telerik:GridViewComboBoxColumnAny help is appreciated.
Header="Percent Allocated"
DataMemberBinding="{Binding PercentAllocated}"
ItemsSource="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.PercentSelections}">
<telerik:GridViewComboBoxColumn.AggregateFunctions>
<telerikData:SumFunction Caption="Total Allocation: ">
</telerikData:SumFunction>
</telerik:GridViewComboBoxColumn.AggregateFunctions>
<telerik:GridViewComboBoxColumn.Footer>
<Style TargetType="telerik:GridViewFooterCell">
<Style.Setters>
<Setter Property="Style" Value="{Binding PercentAllocated, Converter={StaticResource DebuggingConverter}}">
</Setter>
</Style.Setters>
</Style>
</telerik:GridViewComboBoxColumn.Footer>
</telerik:GridViewComboBoxColumn>
Craig
6 Answers, 1 is accepted
0

Craig Corbin
Top achievements
Rank 1
answered on 23 Nov 2010, 02:52 PM
Anyone? Do I need to log a ticket to get this answered?
0
Hello Craig Corbin,
Maya
the Telerik team
As the footer is an object of its nature, you can handle directly the appropriate values and events as required.You may take a look at our demo demonstrating how to customize the column footers. You may just define a TextBlock in the footer for example and work directly with it.
Furthermore, in case you aim at customizing the Group footers as well you may directly use the GroupFooterTemplateSelector.
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0

Craig Corbin
Top achievements
Rank 1
answered on 23 Nov 2010, 05:08 PM
Thank You Maya,
I have successfully implemented the basic functions, aggregate and such.
How do I access the numeric value of the aggregate function in the footer row?
How do I then apply a red background to the cell containing that aggregate value?
Either way is acceptable to me...I just need a complete solution for either way.
Thanks from Craig
I have successfully implemented the basic functions, aggregate and such.
- So for using the aggregate generated footer....
How do I access the numeric value of the aggregate function in the footer row?
How do I then apply a red background to the cell containing that aggregate value?
- For using the textbox formatted footer....
Either way is acceptable to me...I just need a complete solution for either way.
Thanks from Craig
0
Hello Craig Corbin,
Maya
the Telerik team
I am sending you a sample project illustrating a possible approach for achieving the desired functionality.
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0

Craig Corbin
Top achievements
Rank 1
answered on 29 Nov 2010, 07:51 PM
Thanks Maya! I am so much closer to getting this solved!
I should have mentioned earlier, that the target grid is a detail grid that is dynamically generated. I think becuase of this the "ParentOfType" function is returning null. I did use your code sample to change the backgroud of the textbox, but still cannot get a reference to the parent StackPanel to change it's background color...
Here is teh code I am currently using. The commented line is the line where ParentOfType returns null.
I should have mentioned earlier, that the target grid is a detail grid that is dynamically generated. I think becuase of this the "ParentOfType" function is returning null. I did use your code sample to change the backgroud of the textbox, but still cannot get a reference to the parent StackPanel to change it's background color...
Here is teh code I am currently using. The commented line is the line where ParentOfType returns null.
private void OnDetailGridLoaded(object sender, RowLoadedEventArgs e)
{
var detailGrid = e.Row.GridViewDataControl as RadGridView;
if (detailGrid == null) return;
var totalAllocation = (double) (detailGrid.AggregateResults[0]).FormattedValue;
if (totalAllocation > .75)
{
((StackPanel)detailGrid.Columns[2].Footer).Background = new SolidColorBrush(Colors.Red);
// (detailGrid.Columns[2].Footer as StackPanel).ParentOfType<GridViewFooterCell>().Background = new SolidColorBrush(Colors.Green);
}
}
Can you help?
Thanks from Craig
0
Hi Craig Corbin,
Maya
the Telerik team
In order to provide you an appropriate for your exact scenario solution, I would need a bit more information. How do you generate your detail grid ? How do you load your data ? When do you execute the
OnDetailGridLoaded method ? Any relevant details that will help me to simulate your scenario would be valuable.All the best,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight