开发者

WebGrid MVC 3 loses sorting if column is formatted ( format: @<text>) or throws null exception on sorting

WebGrid MVC 3 . Webgrid throws System.NullReferenceException: on sorting. This happens if any of the column value is null . If I use following code to check for the nulls

grid.Column( columnName: "IncomingFile.Name", header: "IncomingFile.Name",  canSort: true, 
            format: @<text> 
                @if (@item.IncomingFile != null)
                {@item.IncomingFile.Name} 
             </text>),           

Then the webgrid loses its sorting c开发者_运维知识库an anyone help how to solve this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜