4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 20 May 2011, 08:22 AM
Hello Sadiq,
You can try the following approach to achieve your requirement.
C#:
Thanks,
Shinu.
You can try the following approach to achieve your requirement.
C#:
protected
void
RadGrid1_ItemCommand(
object
source, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.FilterCommandName)
{
Pair filterPair = (Pair)e.CommandArgument;
GridColumn col = (GridColumn)e.Item.OwnerTableView.GetColumn(filterPair.Second.ToString());
//accessing the column.
col.ItemStyle.BackColor = System.Drawing.Color.Yellow;
}
}
Thanks,
Shinu.
0
Sadiq
Top achievements
Rank 1
answered on 20 May 2011, 02:20 PM
Thanks Shinu!
I made a little change for the color to go away once "NoFilter" is selected:
I made a little change for the color to go away once "NoFilter" is selected:
Private
Sub
RadGrid1_ItemCommand(sender
As
Object
, e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
RadGrid1.ItemCommand
If
e.CommandName = RadGrid.FilterCommandName
Then
Dim
objFilterPair
As
Pair =
CType
(e.CommandArgument, Pair)
Dim
objCol
As
GridColumn =
CType
(e.Item.OwnerTableView.GetColumn(objFilterPair.Second.ToString()), GridColumn)
If
objFilterPair.First.ToString =
"NoFilter"
Then
objCol.ItemStyle.BackColor = Drawing.Color.White
Else
objCol.ItemStyle.BackColor = Drawing.Color.AliceBlue
End
If
End
If
End
Sub
0
Ganapathy
Top achievements
Rank 1
answered on 20 Apr 2016, 07:43 AM
this code is not working how to use ....
0
Hello Ganapathy,
You can use the following approach to traverse the columns:
http://www.telerik.com/forums/customizing-icon-toolitp-when-filtering-radgrid#4exNuSY9JkW1Z7dmYvHKSQ
And inside you can check for the following condition:
You can also check:
http://www.telerik.com/forums/radgrid-enable-filter-code-behind#cel1slcp-U-pmV28CfXTrg
I hope this will prove helpful.
Regards,
Eyup
Telerik
You can use the following approach to traverse the columns:
http://www.telerik.com/forums/customizing-icon-toolitp-when-filtering-radgrid#4exNuSY9JkW1Z7dmYvHKSQ
And inside you can check for the following condition:
Copy Code
foreach
(GridColumn col
in
RadGrid1.MasterTableView.RenderColumns
.OfType<IGridDataColumn>().Where(x => x.AllowFiltering)){
if
(!
string
.IsNullOrEmpty(col.EvaluateFilterExpression()))
{
// add button or or cell highlight
}
}
You can also check:
http://www.telerik.com/forums/radgrid-enable-filter-code-behind#cel1slcp-U-pmV28CfXTrg
I hope this will prove helpful.
Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.