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

Handling NULL values

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RGTech
Top achievements
Rank 1
RGTech asked on 04 May 2013, 11:14 AM

Hi,

I've got a snipplet of C# razor syntax below which builds up columns for a 12 month period.

The Month1-12 fields can be null.
I would like to be able to sort on Month<number>.EHR.

For example I want to sort on month 'Month12.EHR'.
Because Month12 is null, the grid continuously looks like it's loading.

How am I able to sort the grid on columns that have null?

@for (int i = 12; i > 0; i--)
{
    <text>
    {
        field: 'Month@(i).EHR',
        title: 'Month@(i)',
        template: '#if (Month@(i) != null) {#$#:Month@(i).EHR#.00 (#:Month@(i).TotalTime#)#} else {# #:"--"# #} #',
        width: 20
    },
    </text>
}

Thanks, Mike.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 08 May 2013, 08:05 AM
Hello Mike,

As I replied in the support ticket on the same topic, the schema does not support complex fields. You should use server sorting in order to avoid the problem.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
RGTech
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or