Kendo grid columns should be like input fields in the ADD Mode

6 posts, 0 answers
  1. Indika
    Indika avatar
    13 posts
    Member since:
    Mar 2014

    Posted 07 Apr 2014 Link to this post

    We are using Kendo UI grid to import data from one grid to another grid, For that purpose we need to input some data to the kendo grid in the ADD Mode, Unfortunately Kendo grid input only available in the edit mode,I'm using ClientTemplate to input the data,but that is not support exactly,because kendo feature overridden....Please give me a solution to input data...

     @(Html.Kendo().Grid<Portal.Presentation.Web.BoundedContext.TNA.Template.MVC.Areas.Razor.Models.TaskPoupModel>()
                      .Name("importtaskgrid")
                      .AutoBind(true)
                      .HtmlAttributes(new {style = "border: 0;"})
                      .Columns(c =>
                                   {
                                       c.Bound(x => x.TaskId).Hidden();
                                       c.ForeignKey(p => p.TaskGroupId, (System.Collections.IEnumerable) ViewData["TaskGroups"], "Key", "Value").Title("TASK GROUP").Sortable(true);
                                       c.Bound(x => x.TaskName).Title("TASK NAME").Sortable(true);
                                       c.Bound(x => x.LeadTime).Title("LEAD TIME").Sortable(false).
                                           ClientTemplate("<input type='text' name='importtaskgrid[#= ImportPopupHandler.index(data)#].LeadTime' value='#= LeadTime #' validateFor='number'/>");

                                       c.ForeignKey(p => p.UserId, (System.Collections.IEnumerable) ViewData["Users"], "Key", "Value").Title("TASK OWNER").Sortable(true);
                                       c.Bound(x => x.IsImport).ClientTemplate("<input type='checkbox' #= IsImport ? checked='checked' : '' # ></input>").Title("PICK TO IMPORT").Width(100).Sortable(false);
                                   })
                      .Sortable()
                      .Editable(x => x.Mode(GridEditMode.InCell))
                      .DataSource(dataSource => dataSource
                                                    .Ajax().ServerOperation(true)
                                                    .Sort(sort => sort.Add(p => p.TaskName).Descending())
                                                    .PageSize(20)
                                                    .Events(events => events.Error("error_handler"))
                                                    .Model(model =>
                                                               {
                                                                   model.Id(p => p.TaskId);
                                                                   model.Field(p => p.TaskGroupId).Editable(false);
                                                                   model.Field(p => p.TaskName).Editable(false);
                                                                   model.Field(p => p.LeadTime).DefaultValue(0);
                                                                   model.Field(p => p.UserId).DefaultValue(0);
                                                               })
                                                    .Read(read => read.Action("OnPopupTaskRead", "Tna").Data("ImportPopupHandler.getAdditionalData").Type(HttpVerbs.Get)
                                                    ))
                      .Scrollable()        
                      )
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 07 Apr 2014 in reply to Indika Link to this post

    Hello,

    If you want to display KendoDropDown without edit mode.
    http://www.telerik.com/forums/dropdownlist-client-template-using-razor-mvc

    If KendoDropDown not displayed in edit mode.
    Please add all htmlhelper in your View/Shared/EditorTemplate folder.

    Let me know if i am not understand your quetsion.

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 09 Apr 2014 Link to this post

    Hi Indika,


    The forum post that Jayesh provided contains all information that you need to achieve the desired behavior. 

    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Indika
    Indika avatar
    13 posts
    Member since:
    Mar 2014

    Posted 15 Apr 2014 in reply to Jayesh Goyani Link to this post

    I did according to your suggestion...still i could not be able to find the solution for both textbox and combobox...After i did those change combobox is not there as well as both not getting input value....Please give me more details...
  6. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 15 Apr 2014 in reply to Indika Link to this post

    Hello,

    Please provide all file name which exists under below directory in your project.

    View/Shared/EditorTemplate

    Thanks,
    Jayesh Goyani
  7. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 17 Apr 2014 Link to this post

    Hi Indika,

    I would like to add the following help topic to the thread as it contains more information about Grid EditorTemplates which you may find helpful:

    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready