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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How render ejControls in the Edit Form Template of the MVC Grid?

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.

 

Razor

 

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.

 

https://help.syncfusion.com/aspnetmvc/grid/how-to#work-with-partial-views

 

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.

 

 

 

 

Controller

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
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon