Reputation: 45
I am using Kendo Grid for displaying.
@(Html.Kendo().Grid<ReportModel>()
.Name("myReport")
.Columns(cols =>
{
columns.Bound(c => c.sNo).Title("S.No.");
columns.Bound(c => c.particulars).Title("Particulars");
}
)
.DataSource(ds => ds
.Ajax()
.PageSize(20)
.Read(read => read.Action("myReportList","Reporting")
)
.Resizable(resize => resize.Columns(true))
)
I want the formatting of the row to change to bold if and only if the cell in the SNo column is an alphabet otherwise the formatting must be normal.
Help me achieve this.
Upvotes: 2
Views: 4017
Reputation: 1
You can write it like this:
columns.Bound(c => c.sNo)
.ClientTemplate("<strong> #=DateOfService#</strong>")
.Title("S.No.")
Upvotes: 0
Reputation: 4139
There are a few different ways to achieve that:
- Use a row template. This approach is suitable if you do not intend to apply hierarchy, grouping, editing, and frozen columns to the Grid.
- Use a databound handler and iterate the table rows. This approach is suitable if you intend to customize all rows of the Grid.
- Use a databound handler and iterate the data items. This approach is suitable if you intend to customize only part of the Grid rows.
Upvotes: 1