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
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?

Platform: ASP.NET Web Forms |
Control: 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.




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.

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile