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

How To Apply Conditional Formatting To A GridViewColumn.FooterCellStyle?

4 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 29 Apr 2013, 06:53 PM
Hi,

I would like to add conditional formatting to cells in the summary footer row (I want the display values from GridViewColumn.AggregateFunctions to have different background colors based on if they are negative or positive, plus other conditions).

I see that there is a property for GridViewColumn.GroupFooterCellStyleSelector, but what I think I need is one for a property that does not exist in the API:  GridViewColumn.FooterCellStyleSelector...

How should I proceed?

Kind Regards,
Albert

4 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 30 Apr 2013, 02:11 PM
Hello Albert,


I have prepared a sample project that you can find attached. It shows you a possible approach for achieving the desired functionality.

I hope this is what you need.

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Albert
Top achievements
Rank 1
answered on 30 Apr 2013, 03:57 PM
Hello Yoan,

Thanks for the reply. I see that you are handling the RadGridView.AutoGeneratingColumn event to achieve the "GridViewColumn.FooterCellStyleSelector" type of behaviour I need.

The grid I am working on has AutoGenerateColumns="False". Can you recommend another event to handle, please?

Kind Regards,
Albert
0
Yoan
Telerik team
answered on 03 May 2013, 12:10 PM
Hello Albert,

In this case you can handle the CellEditEnded event:

private void clubsGrid_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            this.clubsGrid.Columns["StadiumCapacity"].Footer = ((DataTemplate)this.Resources["ss"]).LoadContent();
        }

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Yoan
Telerik team
answered on 03 May 2013, 12:37 PM
Hello Albert,

Just a quick update - Actually, you can apply the Footer's style right after InitializeComponent() :

public MainWindow()
       {
           InitializeComponent();
 
           this.clubsGrid.Columns["StadiumCapacity"].Footer = ((DataTemplate)this.Resources["ss"]).LoadContent();
       }



All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Albert
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Albert
Top achievements
Rank 1
Share this question
or