I have a kendo grid for user managment when I go to edit a user fields that are nullable byte keep on saying that the fields are required if i don't select a value for them.
Here is my view code for these and model.
Here is my view code for these and model.
<
div
class
=
"phoneNumberEntry"
>
<
div
class
=
"phoneModalDropdown"
>@Html.DropDownListFor(model => Model.Phone1.PhoneTypeId, ViewBag.PhoneTypeList1 as SelectList, new { @style = "width: 105px" })</
div
>
<
span
class
=
"phoneNumber"
>@Html.EditorFor(model => Model.Phone1.PhoneNumber)</
span
>
<
span
class
=
"extension"
>@Html.EditorFor(model => Model.Phone1.PhoneExtension)</
span
>
<
span
class
=
"isPrimary"
>Primary: <
input
type
=
"checkbox"
data-bind
=
"checked: Phone1.IsPhonePrimary"
/></
span
>
</
div
>
<
div
class
=
"phoneNumberEntry"
>
<
div
class
=
"phoneModalDropdown"
>@Html.DropDownListFor(m => m.Phone2.PhoneTypeId, ViewBag.PhoneTypeList2 as SelectList, "Select Type", new { @style = "width: 105px" })</
div
>
<
span
class
=
"phoneNumber"
>@Html.EditorFor(model => Model.Phone2.PhoneNumber)</
span
>
<
span
class
=
"extension"
>@Html.EditorFor(model => Model.Phone2.PhoneExtension)</
span
>
<
span
class
=
"isPrimary"
>Primary: <
input
type
=
"checkbox"
data-bind
=
"checked: Phone2.IsPhonePrimary"
/></
span
>
</
div
>
<
div
class
=
"phoneNumberEntry"
>
<
div
class
=
"phoneModalDropdown"
>@Html.DropDownListFor(m => m.Phone3.PhoneTypeId, ViewBag.PhoneTypeList3 as SelectList, "Select Type", new { @style = "width: 105px" })</
div
>
<
span
class
=
"phoneNumber"
>@Html.EditorFor(model => Model.Phone3.PhoneNumber)</
span
>
<
span
class
=
"extension"
>@Html.EditorFor(model => Model.Phone3.PhoneExtension)</
span
>
<
span
class
=
"isPrimary"
>Primary: <
input
type
=
"checkbox"
data-bind
=
"checked: Phone3.IsPhonePrimary"
/></
span
>
</
div
>
public class PhoneType
{
public string PhoneTypeDesc
{ get; set; }
public byte? PhoneTypeId
{ get; set; }
}