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

C# to Add Css Class To Asp.Net RadGrid Ajax

1 Answer 654 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Johnathan
Top achievements
Rank 1
Johnathan asked on 25 Jan 2018, 12:17 AM

I am attempting to use the below to apply a css class to rows in my rad grid.  I am only showing a brief portion of the code behind as I only need to apply this to a few of the rows.

However, the css is not applied.  What would be the proper way to achieve such?

 

foreach (GridDataItem row in r.MasterTableView.Items)
{
row.CssClass = "blamanca";
}

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 29 Jan 2018, 01:13 PM
Hi Johnathan,

The following help article explains in details the possible ways to style the rows in RadGrid, please examine it and choose the approach that fits your needs the best:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/appearance-and-styling/conditional-formatting

You can also find useful information on how to access the rows of the control here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-rows

Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Johnathan
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or