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

DialogTemplate Editing

Hi,

I am using the syncfusion grid and i wanna use the dialogtemplate editing in servermode.
My problem is that the form inside the template is not working, the buttons are hidden and when i look the html page i see that syncfusion already set a form for my dialog.

So my question is how can i do to use your form or at least how can i do to use my form?

here is my grid :

@{   
    Html.Syncfusion().Grid<TRA_ADRESSE>("Adresses")
    .Datasource(Model).Caption("Adresses")
    .ToolBar(tools =>{
        tools.Add(GridToolBarItems.AddNew)
            .Add(GridToolBarItems.Edit);
    })
    .ActionMode(ActionMode.Server)
    .ClientSideEvents(e =>{
        e.OnActionSuccess("BeginAdresseModification");
    })
    .QueryParam(QueryParam)
    .Editing(edit =>{
        edit.EditMode(GridEditMode.DialogTemplate);
        edit.DialogModeEditorTemplate("_ModificationAdresseTemplate");
        edit.Dialog(dialog =>{
            dialog.Resizable(false);
            dialog.Draggable(true);
            dialog.Height(290);
            dialog.Width(750);
            dialog.Position(Syncfusion.Mvc.Tools.DialogPositions.Center);
            dialog.Show(Syncfusion.Mvc.Tools.DialogAnimations.slide);
            dialog.Hide(Syncfusion.Mvc.Tools.DialogAnimations.blind);});
        edit.AllowEdit(true)
            .AllowNew(true);
        })
    .AutoFormat(Skins.Turquoise)
    .Column(col =>
        {
            col.Add(c => c.ID).Visible(false);
            col.Add(c => c.ID_TYPADRS_DEST).HeaderText("Type").TemplateColumn(true).TemplateName("_TypeDestAdrs");
            col.Add(c => c.ADRESSE_1).HeaderText("Adresse").TemplateColumn(true).TemplateName("_AdresseCompleteAdrs");
            col.Add(c => c.CODE_POSTAL).HeaderText("CP");
            col.Add(c => c.BUREAU_DISTRIB).HeaderText("Ville");
            col.Add(c => c.ACTIF).HeaderText("Actif").TemplateColumn(true).TemplateName("_ActifCheckBoxAdrs");
            col.Add(c => c.DATE_ACTIF).HeaderText("Date ACtif");

        })
    .EnableSorting()
    .AllowAutoWrap(true)
    .AllowResizing(false)
    .AllowDragAndDrop(false)
    .Render();
}

here is my methods :

        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult init_AdhDetails(int id, string type_objet)
        {
            if (id >= 0)
            {
                string tmp = Request.Url.Query;
                if (tmp.Contains("&_="))
                    ViewBag.QueryParam = tmp.Remove(tmp.IndexOf("&_="));
                else
                    ViewBag.QueryParam = tmp;
                return PartialView("_EntiteDetail", _EntiteManager.RecupererAdhDetail(id, type_objet, Infrastructure.Data.Utils.SorUtils.ObtenirNomUtilisateur(User)));
            }
            return PartialView("_EntiteDetail", new AdherentComplet());
}

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult init_AdhDetails(PagingParams args, int id, string type_objet)
        {
            if (id >= 0)
            {
                RequestType currentRequest = (RequestType)Convert.ToInt32(args.RequestType);
                if (currentRequest == RequestType.BeginEdit)
                {
                    var adrs = _EntiteManager.RecupererAdresseCourante(id, type_objet);
                    List<TRA_ADRESSE> data = new List<TRA_ADRESSE>();  
                    data.Add(adrs);
                    return PartialView("_ModificationAdresseTemplate", adrs);
                }
                if (currentRequest == RequestType.Delete)
                {
                    TRA_ADRESSE adrs = _EntiteManager.RecupererAdresseCourante(id, type_objet);
                    List<TRA_ADRESSE> data = new List<TRA_ADRESSE>();
                    data.Add(adrs);
                    return data.GridActions<TRA_ADRESSE>();
                }
            }
            return null;
        }

and here is my template :

@using (Ajax.BeginFormExt("AdresseEditSave", "Entite",
            new AjaxOptions
            {
                HttpMethod = "POST",
                OnBegin = "AdresseFormCheck",
                LoadingElementDuration = 5
            }))
{
    <div id="AdresseDialogEdition" style="height: auto;margin-left: 2px;">
        <div id="localisation-geographique">
            <div id="adresses">
                @Html.Label("Type : ")@Html.DropDownListFor(model => model.ID_TYPADRS_DEST, selectList)
                <br />
                @Html.Label("Adresse :")@Html.TextBoxFor(model => model.ADRESSE_1, new { style = "width=400px;margin-left:3px;" })
                <br />
                @Html.TextBoxFor(model => model.ADRESSE_2, new { style = "width=400px;margin-left:50px;" })
                <br />
                @Html.TextBoxFor(model => model.ADRESSE_3, new { style = "width=400px;margin-left:50px;" })
                <br />
                @Html.TextBoxFor(model => model.ADRESSE_4, new { style = "width=400px;margin-left:50px;" })
            </div>
            <div>
                @Html.Label("CP : ") @Html.TextBoxFor(model => model.CODE_POSTAL, new { style = "width=auto;" })
                @Html.Label("Ville : ")
                @Html.TextBoxFor(model => model.BUREAU_DISTRIB, new { style = "width=auto;" }) @Html.Label("Pays : ")
                @Html.DropDownListFor(model => model.ID_PAYS, ListePays, new { style = "width=auto;" })
            </div>
        </div>
        <div id="info-numerique" style="display: inline;">
            @Html.Label("Téléphone :") @Html.TextBoxFor(model => model.TELEPHONE, new { style = "width=auto;" })
            @Html.Label("Fax :") @Html.TextBoxFor(model => model.TELECOPIE, new { style = "width=auto;" })
            @Html.Label("Portable :") @Html.TextBoxFor(model => model.GSM, new { style = "width=auto;" })
            <br />
            @Html.Label("Mail :") @Html.TextBoxFor(model => model.EMAIL, new { style = "width=auto;" })
            <div id="actif">
                @Html.Label("Actif : ")
                <input id="EntiteCheckBoxActif+@Model.ID" type="checkbox" checked="@Model.ACTIF ? checked : """ onclick= "return false"/>
            </div>
        </div>
        <div id="buttons" style="visibility: visible;">
            @(new HtmlString(Html.Syncfusion().Button("ModificationAdresseValider").Type(ButtonTypes.Submit).Text("Valider").Skin(Skins.Turquoise).ToString()))
            @(new HtmlString(Html.Syncfusion().Button("ModificationAdresseReset").Type(ButtonTypes.Reset).Text("Annuler").Skin(Skins.Turquoise).ToString()))
        </div>
    </div>

}

1 Reply

AS Alan Sangeeth S Syncfusion Team January 8, 2014 06:19 AM UTC

Hi Alexis,

Thanks for using Syncfusion products.

We regret to let you know that we are unable to reproduce your issue in our end. We have created a simple sample and the same can be downloaded from below link.

Sample:

DialogTemplate.zip

Could you please replicate your issue in the above sample and send back to us with more information so that we could sort out the cause of the issue and provide you a better solution quickly? The information provided would be a great help for us to resolve your issue.

Please let us know if you need any further assistance.

Regards,
Alan Sangeeth S


Loader.
Live Chat Icon For mobile
Up arrow icon