This is a migrated thread and some comments may be shown as answers.
Kendo grid columns should be like input fields in the ADD Mode
5 Answers 69 Views
This is a migrated thread and some comments may be shown as answers.
attuneIT
Top achievements
Rank 1
attuneIT asked on 07 Apr 2014, 06:30 AM
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()        
                  )

5 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 07 Apr 2014, 10:49 AM
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
0
Vladimir Iliev
Telerik team
answered on 09 Apr 2014, 07:33 AM
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.

 
0
attuneIT
Top achievements
Rank 1
answered on 16 Apr 2014, 04:21 AM
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...
0
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Apr 2014, 04:45 AM
Hello,

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

View/Shared/EditorTemplate

Thanks,
Jayesh Goyani
0
Vladimir Iliev
Telerik team
answered on 17 Apr 2014, 09:11 AM
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.

 
Tags
Grid
Asked by
attuneIT
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Vladimir Iliev
Telerik team
attuneIT
Top achievements
Rank 1
Share this question
or