Thank you for contacting us and for your questions.
In order to have red background, when there are no results left in RadGrid, you could set the NoRecordsTemplate as following:
There are no records to display!
and the corresponding CSS class for the div element:
However, the other part where you want to change the background color of the filtered items is tricky. In order to change the color of filtered items, you should hook the ItemCommand
event of RadGrid. In its body you should check if the command name is grid FilterCommandName
. And if the value is true to find the filtered column and to set its ItemStyle
's CssClass property to the name of the CSS class that will be applied.
sender, GridCommandEventArgs e)
(e.CommandName == RadGrid.FilterCommandName)
Pair filterPair = (Pair)e.CommandArgument;
colName = filterPair.Second.ToString();
GridColumn column = radgridRedeemSummary.MasterTableView.GetColumnSafe(colName)
And the CSS class:
Give this code a try and let me know if it is working for you.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed