I'm working on the bug where one screen has a grid that contains a column showing numbers, but when I try to filter it, it has "contains" option.
When I type 0, I'm getting an error.
I need to filter that column as a number not as a string.
This is the fragment of the code:
<p>columns.Bound(x => x.DebitAmount).Title(
"Debit"
).Width(300).ClientTemplate(
"#=kendo.toString(DebitAmount,'c') #"
).ClientFooterTemplate(
"#=kendo.toString(sum,'c') #"
);
columns.Bound(x => x.CreditAmount).Title(
"Credit"
).Width(300).ClientTemplate(
"#=kendo.toString(CreditAmount,'c') #"
).ClientFooterTemplate(
"#=kendo.toString(sum,'c') #"
);
...............................other columns..........................
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu)
.Extra(
false
)
.Operators(operators => operators
.ForString(str => str.Clear()
.Contains(
"Contains"
)
.IsEqualTo(
"EqualTo"
)
.IsNotEqualTo(
"NotEqualTo"
)
.IsEmpty(
"Empty"
)))
.Operators(operators => operators
.ForNumber(str => str.Clear()
.IsEqualTo(
"EqualTo"
)
.IsGreaterThan(
"GreaterThan"
)
.IsLessThan(
"LessThan"
)
)).Messages(m => m.IsFalse(
" False "
))
.Messages(m => m.IsTrue(
"True "
)))
The model declares those fields as decimal
The generated columns show "Contains" filter, even though the value are decimal
I have another screen that shows decimal number as well, where filter is defined the same way, however, it does not include "contains" filter option.
This is the code:
columns.Bound(c => c.Amount).Title(
"Amount"
).ClientTemplate(
"#= kendo.toString(Amount,'c')#"
).Width(
"120px"
);
.................other columns.................
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu)
.Extra(
false
)
.Operators(operators => operators
.ForString(str => str.Clear()
.Contains(
"Contains"
)
.IsEqualTo(
"EqualTo"
)
.IsNotEqualTo(
"NotEqualTo"
)
.IsEmpty(
"Empty"
)))
.Operators(operators => operators
.ForNumber(str => str.Clear()
.IsEqualTo(
"EqualTo"
)
.IsGreaterThan(
"GreaterThan"
)
.IsLessThan(
"LessThan"
)
)))
Everything seems the same (except of messages part) when defining the filter operations, but somehow, on the first screen, the "contains" operation is included and on the second is not.
What am I missing?