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

Problem select cell and change Background column

0 Answers 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gerardo
Top achievements
Rank 1
Gerardo asked on 21 Jul 2011, 07:37 AM
Hello,

I want to change background color to gridview column when user click in a cell. I have this code:

 

private void SelectColumn (string columnName)
{

  foreach (var column in GridViewNew.Columns)
                {
                    if (column == columnName)
                    {
                        ((GridViewDataColumn)column ).Background = new SolidColorBrush(Color.FromArgb(255, 165, 215, 241));                       

                    }
                    else
                    {                     
                        ((GridViewDataColumn) column ).Background = new SolidColorBrush(Colors.White);                       
                    }
                }
}

At first it works, but when i click over another cell, the column chages its color but column´s footer doesn´t.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Gerardo
Top achievements
Rank 1
Share this question
or