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

CRUD with MVC model Data Annotations Dialog Template using model

Hi.

I saw the response for the post "Datasource with model and Data Annotations with URL insert, edit, delete in a grid with dialogtemplate", thread # 124436.

I would like to use helper controls in the template (modal dialog), like @Html.EJ().NumericTextbox, etc using model object,.

Is there a way to use a partial view instead javascript template for modal CRUD with MVC Data Annotations? I think that will be ease to write the Razor code instead directly html/javascript code.

The partial views will be like this:

@model mymodel

<form id="formCRUD" method="post">
   <div class="panel panel-primary">
                    <div class="panel-heading text-center">
                        <h3 class="panel-title">My Title</h3>
                    </div>
                    <div id="corpoForm" class="panel-body">
                        <fieldset>
                            <div class="form-group">
                                @Html.LabelFor(m => m.pro1, new { @class = "control-label" })
                                @Html.EJ().NumericTextbox(m => m.prop1, new { @class = "form-control", placeholder = "my placeholder..." })
                            </div>
                          ...
                        </fieldset>
                       <div class="panel-footer">
                          ...
                        </div>
   </div>
</div>


Thank you.

3 Replies

KK Karthick Kuppusamy Syncfusion Team June 13, 2016 11:42 AM UTC

Hi Sidnei,   
  
Thanks for contacting Syncfusion support.   
  
We can’t use the HTML helper of ejcontrols in the template using model object in partial view. While rendering HTML helper of ejcontrols inside the template in partialview Jsrender will append the element to the template without the instance of ejcontrols. So, the bindings of the ejcontrols will not work.   
  
We can use other default HTML helper elements like textbox, default dropdown in the template with the partial view.   
  
Regards,   
Karthick K.  



SV Sidnei V Lavandoski June 13, 2016 03:55 PM UTC

Thank you Karthick, but I was thinking to use MVC Razor Partial View instead template.

Can I disable the EditMode and use a "Edit Custom Mode", customizing Toolbar buttons to call the Controllers for CRUD?

In fact I would like to use all functions of EJ Grid and use external Bootstrap modal to CRUD operations, like this example http://www.advancesharp.com/blog/1125/search-sort-paging-insert-update-and-delete-with-asp-net-mvc-and-bootstrap-modal-popup-part-1

Thank you again.


KK Karthick Kuppusamy Syncfusion Team June 14, 2016 11:17 AM UTC

  
Hi Sidnei, 
We considered this “Customizing Toolbar buttons to call the Controllers for CRUD operation as an custom sample request and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 
 
 
Regards, 
K.Karthick. 


Loader.
Live Chat Icon For mobile
Up arrow icon