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

[Solved] change the filtercolumn header backcolor

3 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 14 May 2013, 12:36 PM
Hi
    How shall I change the filtercolumn header backcolor after filter.

thanks
RT

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 May 2013, 12:46 PM
Hi,

I guess you want to change the Background color of the filter row. Please take a look into the following css.

CSS:
.RadGrid_Default .rgFilterRow td
 {
    background-color: red ! important;
}

Thanks,
Princy.
0
Ryan
Top achievements
Rank 1
answered on 15 May 2013, 12:47 PM
Hi again,
  thanks for the support Princy, but i wanted to change the header color of the filtered column only. Hope its clear

thank you
RT
0
Princy
Top achievements
Rank 2
answered on 16 May 2013, 04:06 AM
Hi,

Please try the following code snippet to give Background color for the Filtered row.

C#:
public static string filter = "";
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridFilteringItem)
    {
        GridFilteringItem item = (GridFilteringItem)e.Item;
        if (filter != "")
        {
            item[filter].BackColor = Color.Red;
        }
    }
}
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.FilterCommandName)
    {
        Pair filterPair = (Pair)e.CommandArgument;          
        filter = filterPair.Second.ToString();           
    }
}

Thanks,
Princy.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ryan
Top achievements
Rank 1
Share this question
or