We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Cannot edit field with column template

Hi

I have a grid defined as :


@(Html.EJ().Grid<Enquiry_History>("Grid")

.Datasource(ds => ds.URL(@Url.Action("DataSource", new { id = Model.ID }))

.CrudURL(@Url.Action("CrudUpdate", new { id = Model.ID }))

.Adaptor(AdaptorType.UrlAdaptor))

.AllowPaging()

.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Dialog); })

.ToolbarSettings(toolbar =>

{

toolbar.ShowToolbar().ToolbarItems(items =>

{

items.AddTool(ToolBarItems.Add);

items.AddTool(ToolBarItems.Edit);

items.AddTool(ToolBarItems.Delete);

items.AddTool(ToolBarItems.Update);

items.AddTool(ToolBarItems.Cancel);

});

})

.Columns(col =>

{

col.Field("ID" ).Visible(false).IsPrimaryKey(true).Add();

col.Field("Enquiry_id").Visible(false).Add();

col.Field("Course_type_id" ).HeaderText("Course Type").ForeignKeyField("value").ForeignKeyValue("text").DataSource((IEnumerable<object>)ViewBag.Course_types).Add();

col.Field("No_of_delegates").HeaderText("Delegates").TextAlign(TextAlign.Left).Add();

col.Field("Comment").HeaderText("Comment").AllowEditing(true).Template(true).TemplateID("#columnTemplate").Add();

})

)

My JS is

<script type="text/x-jsrender" id="columnTemplate">

<textarea rows="4" cols=95%>{{:Comment}}</textarea>

</script>

The dialog edit box shows up correctly but when I press save the record received at the controller has the comment field set to null all other fields can be edited correctly.

What am I doing wrong



Regards


Martin



1 Reply

RU Ragavee U S Syncfusion Team April 4, 2016 12:00 PM UTC

Hi Martin,

We considered this query “Editing support for field bound template column” as a usability feature and a support incident has been created under your account to track the status of this issue. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,
Ragavee U S.

Loader.
Live Chat Icon For mobile
Up arrow icon