How To Apply Conditional Formatting To A GridViewColumn.FooterCellStyle?

5 posts, 0 answers
  1. Albert
    Albert avatar
    28 posts
    Member since:
    Sep 2012

    Posted 29 Apr 2013 Link to this post

    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
  2. Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 30 Apr 2013 Link to this post

    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.

  3. Albert
    Albert avatar
    28 posts
    Member since:
    Sep 2012

    Posted 30 Apr 2013 Link to this post

    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
  4. Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 03 May 2013 Link to this post

    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.

  5. Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 03 May 2013 Link to this post

    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.

Back to Top