Skip to content

Commit b6fe6bd

Browse files
committed
Properly pass auto sort field along to bool template
1 parent a66ae01 commit b6fe6bd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Build/CommonAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
//
1616
// You can specify all the values or you can default the Revision and Build Numbers
1717
// by using the '*' as shown below:
18-
[assembly: AssemblyVersion("1.0.35.0")]
19-
[assembly: AssemblyFileVersion("1.0.35.0")]
18+
[assembly: AssemblyVersion("1.0.36.0")]
19+
[assembly: AssemblyFileVersion("1.0.36.0")]

Griddly.Mvc/GriddlySettings.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ public GriddlySettings<TRow> Column<TProperty>(Expression<Func<TRow, TProperty>>
258258
if (caption == null)
259259
caption = metadata.DisplayName ?? metadata.PropertyName ?? htmlFieldName.Split('.').Last();
260260

261+
if (sortField == null)
262+
sortField = htmlFieldName;
263+
261264
if (type == typeof(bool) && (BoolTrueHtml != null || BoolFalseHtml != null))
262265
{
263266
return TemplateColumn(
@@ -274,7 +277,7 @@ public GriddlySettings<TRow> Column<TProperty>(Expression<Func<TRow, TProperty>>
274277
Template = (row) => compiledTemplate(row),
275278
Caption = caption,
276279
Format = format,
277-
SortField = sortField ?? htmlFieldName,
280+
SortField = sortField,
278281
DefaultSort = defaultSort,
279282
ClassName = className,
280283
IsExportOnly = isExportOnly,

0 commit comments

Comments
 (0)