CheckBoxFor EditorTemplate in Grid

8 posts, 1 answers
  1. Reafidy
    Reafidy avatar
    18 posts
    Member since:
    Sep 2014

    Posted 06 Aug Link to this post

    I have a checkbox in a grid:

    columns.Bound(p => p.Display);

    I also have the following editor template:

    @model Boolean
    @Html.Kendo().CheckBoxFor(m => m)

    During editing the checkbox editor template does show, however the checked state is always false even when the underlying data is true.

  2. Georgi
    Admin
    Georgi avatar
    160 posts

    Posted 09 Aug Link to this post

    Hello Reafidy,

    In order to change the default editor widget for a field, it is necessary to specify the name of the editor in the model using DataAnnotations UIHint attribute. 

    e.g.
    public class YOUR_MODEL
        ...
      
     [UIHint("Boolean")] // Boolean is the name of the view that contains the editor
     public bool Display{ get; set; }
      
        ...
      
    }

    The following article illustrate illustrates the aforementioned approach step by step:



    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Reafidy
    Reafidy avatar
    18 posts
    Member since:
    Sep 2014

    Posted 10 Aug Link to this post

    Sorry I should have mentioned I have already set the UIhint attribute:

    [UIHint("Boolean")]
    public Boolean Display { get; set; }

     

    If I switch to a standard checkbox (as below) it works fine, so why would the kendo checkbox not work correctly?

    @model Boolean
     
    @*@Html.Kendo().CheckBoxFor(m => m)*@
    <div class="editor-for">
        @Html.CheckBox("", Model, new { @class = "tickbox-single-line" })
    </div>

     

  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1768 posts

    Posted 15 Aug Link to this post

    Hi,

    Currently there is an issue that affects the Kendo CheckBox binding when it is used as editor in the Grid component. The developers are aware of this and are doing their best to provide a fix as soon as possible. 

    Until a fix is available I would suggest using a regular CheckBox. I apologize for any inconvenience this may cause you.


    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Reafidy
    Reafidy avatar
    18 posts
    Member since:
    Sep 2014

    Posted 02 Sep in reply to Viktor Tachev Link to this post

    Is there somewhere I can track the progress on this?

  6. Answer
    Georgi
    Admin
    Georgi avatar
    160 posts

    Posted 06 Sep Link to this post

    Hello Reafidy,

    You can track the issue in the following link:



    Regards,
    Georgi
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Frederic
    Frederic avatar
    1 posts
    Member since:
    Feb 2013

    Posted 02 Oct Link to this post

    Is it possible that this issue affects not only the CheckBox but also the DatePicker?

    I just played around with the Grid control and some other Kendo elements within the grid using Editor Templates.

    Ordinary text boxes, numeric text boxes and DropDownLists work fine, but the DatePicker and the CheckBox do not.

    In both cases, values disappear when switching into edit mode (InLine).

    Furthermore, values get lost when switching back into read mode.

    This indicates that bindings obviously do not work in any direction.

  8. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1768 posts

    Posted 05 Oct Link to this post

    Hi Frederic,

    Please ensure that the editors are defined as [WidgetName]For. In that case the relevant field in the Model should be bound to the respective editor automatically. 

    In case the behavior persists please send us a runnable sample where it is replicated so we can examine it.

    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top