Default value for nullable value

5 posts, 0 answers
  1. Konstantin
    Konstantin avatar
    39 posts
    Member since:
    Mar 2018

    Posted 08 Jul 2019 Link to this post

    Hello, in example https://dojo.telerik.com/ahepILiP, if field is nullable: true, then default value not used.

    In version 2019.2.619 of kendo ui mvc wrappers for all srting values initialize "nullabe: true"

    changes: Kendo.Mvc/UI/DataSource/ModelDescriptor.cs

    +                    IsNullable = p.ModelType.Name == "String" ? true : p.IsNullableValueType

    And all my default values for string fields is null, if remove this changes then work fine.

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 10 Jul 2019 Link to this post

    Hello,

    I am afraid that with our last official release we introduced a regression bug that affects applying default values with some fields (in this case string type of fields). Currently we are working on fixing this problem with highest priority and I will let you know in this thread when the fix will be available in the latest internal build. 

    In the meantime you can use the  BeforeEdit() event handler to avoid this problem as shown below: 

    .Events(e=>e.BeforeEdit("onBeforeEdit"))
    <script>
        function onBeforeEdit(e) {
          if(e.model.isNew()){
            e.model.ContactName = "Test";
          }
        }
    </script>


    Thank you for understanding. 

    Regards,
    Boyan Dimitrov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 18 Jul 2019 Link to this post

    Hello,

    I am glad to inform you that the issue with not applying default values is resolved in our Latest Internal Build (2019.2.718). I would like to encourage you to download the LIB from your account and let us know how that worked. 

    Regards,
    Boyan Dimitrov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Konstantin
    Konstantin avatar
    39 posts
    Member since:
    Mar 2018

    Posted 18 Jul 2019 in reply to Boyan Dimitrov Link to this post

    Hello,

    Do you fix it in javascript or C#? I am use self resources and compile self library where i remove this changes. Internal build don't conains sources and i can't check it.

  5. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1081 posts

    Posted 22 Jul 2019 Link to this post

    Hi, Konstantin,

    The changes were made to the wrappers with C#:

    Kendo.Mvc/UI/DataSource/ModelDescriptor.cs
    Kendo.Mvc/UI/DataSource/ModelFieldDescriptor.cs
    Kendo.Mvc/UI/TreeList/TreeListModelDescriptor.cs

    I will create a ticket on your behalf and send you these files shortly.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top