Grid supports several Editors of Syncfusion controls (DatePicker, DateTimePicker and DropDownList) to be rendered in the Editform using the jsrender concept. But MVC controls of the Syncfusion cannot be placed in the edit form using the jsrender concept. However, we have placed the MVC controls within the editform using the partial view concept of the MVC.
Template rendering in edit form is supported with the InlineFormTemplate and ExternalFormTemplate. To enable these modes, you must mention the EditMode as InlineFormTemplate or ExternalFormTemplate along with the template ID as shown in the following code example.
Editing Template – EditPage.cshtml
In the EditPage.cshtml (a partial view), place the Syncfusion MVC controls as a template to the Edit Form.
Please make a note that the Partial View page is having the ScriptManager to render the Syncfusion Controls. Since we have rendered the controls in the non-unobtrusive mode, we have mentioned this.
We have already discussed about rendering Syncfusion Controls in the Partial Views in following Help Document.
While editing the record we need to pass the primaryKey value of that corresponding record as a query string in the ActionComplete event of grid and call EditPartial method in the Home controller with these details through Ajax call within the same ActionComplete event for rendering the Syncfusion MVC controls in the Edit Form of the Grid after the Ajax success call.
EditPartial Method will handle the Ajax handler of the MVC control rendering and it will receive the ID of the respective editing record using the QueryString. Based on the PrimaryKey value, records were pulled from the server and later assigned to the MVC controls using the MVC model concept.
The following screenshot shows the Grid with Edit form rendered from the partial view and Syncfusion MVC Controls.
Figure: Grid with the inline form template holding MVC controls.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|
|7747||06/05/2017||06/05/2017||ASP.NET Web Forms||Grid|