Hi
I have a gridview inside another gridview using SetDetailRowTemplateContent.
The inside gridview is using GridViewEditingMode.Batch and was working fine until I upgraded to 15.1.7. There was an internal devexpress error (I didn't note it) and I realizes that it happened when I included the line "settings.SettingsEditing.Mode = GridViewEditingMode.Batch;" in the inside gridview. I reverted to version version 15.1.6 and everything works fine.
Here's the code. ( I also included the files in a zip file)
Outside gridview
C#@using System.Drawing
@using DevExpress.Data
@using DevExpress.Web.Mvc.UI
@using SoucyHelper
@Html.DevExpress().GridView( //CoitemGridview
settings =>
{
...
settings.Name = "CoitemGridview";
...
settings.CallbackRouteValues = new {Controller = "Home", Action = "CoitemGridView", Area = ""};
settings.SettingsEditing.BatchUpdateRouteValues = new { Controller = "Home", Action = "UpdateCoitemGridView", Area="" };
settings.SettingsEditing.Mode = GridViewEditingMode.Batch;
settings.SettingsEditing.BatchEditSettings.EditMode = GridViewBatchEditMode.Cell;
settings.SettingsEditing.BatchEditSettings.StartEditAction = GridViewBatchStartEditAction.Click;
settings.Styles.BatchEditModifiedCell.BackColor = Color.PeachPuff;
settings.CommandColumn.Visible = false;
...
#region Detail Row
settings.SettingsDetail.AllowOnlyOneMasterRowExpanded = false;
settings.SettingsDetail.ShowDetailRow = true;
settings.SetDetailRowTemplateContent(c =>
{
if (DataBinder.Eval(c.DataItem, "type").ToString() == "R")
{
ViewContext.Writer.Write("Détails seulement disponibles pour une commande ouverte.");
}
else
{
Html.RenderAction("CoitemLancements", new { rowpointer = DataBinder.Eval(c.DataItem, "ParentRowPointer") });
}
});
#endregion
...
#region Client Side Events
settings.ClientSideEvents.FocusedRowChanged = "OnCoitemGridviewFocusedRowChanged";
#endregion
...
}).Bind(Model.Coitems).GetHtml()
inside gridview
C#@using System.Drawing
@using DevExpress.Web.Mvc.UI
@using SoucyHelper
@model IEnumerable<SuiviCommande.Models.Coitem_Lancements_Result>
@Html.DevExpress().GridView(
settings =>
{
#region Declarations
bool isSAC = User.IsInRoles(Config.AccessRoles["SAC"]);
bool isSoum = User.IsInRoles(Config.AccessRoles["SOUM"]);
bool isTotal = User.IsInRoles(Config.AccessRoles["TotalWrite"]);
#endregion
#region Basic Settings
settings.Name = "CoitemLancementsGridview_" + ViewData["RowPointer"];
settings.KeyFieldName = "ValidationRowPointer";
settings.KeyboardSupport = true;
#endregion
#region Styles
settings.Styles.AlternatingRow.Enabled = DefaultBoolean.True;
settings.ControlStyle.Paddings.Padding = Unit.Pixel(0);
settings.ControlStyle.Border.BorderWidth = Unit.Pixel(1);
#endregion
#region Behavior
settings.SettingsBehavior.AllowSort = false;
#endregion
#region Callbacks and EditMode
settings.CallbackRouteValues = new { Controller = "Home", Action = "CoitemLancements", rowpointer = ViewData["RowPointer"] };
settings.SettingsEditing.BatchUpdateRouteValues = new { Controller = "Home", Action = "UpdateCoitemLancementGridView", rowpointer = ViewData["RowPointer"] };
settings.SettingsEditing.Mode = GridViewEditingMode.Batch; //<-- THE ERROR HAPPENED WHEN I UNCOMMENTED THIS LINE
settings.SettingsEditing.BatchEditSettings.EditMode = GridViewBatchEditMode.Cell;
settings.SettingsEditing.BatchEditSettings.StartEditAction = GridViewBatchStartEditAction.Click;
settings.Styles.BatchEditModifiedCell.BackColor = Color.PeachPuff;
#endregion
#region Pager
settings.SettingsPager.Mode = GridViewPagerMode.ShowAllRecords;
#endregion
...
}).Bind(Model).GetHtml()
Hi,
I've created a sample project that implements a similar configuration and I am not able to reproduce the issue there. See the attachment. Would you please modify my project to reproduce the issue, so I can research it?
In the meantime, review the Manual Integration into an Existing Project article. Make sure that you've completed all the steps mentioned there.
I will do it gladly - but i have to present my working sprint from my development platform… Since installation to 15.1.7 and back to 15.1.6 takes around 3 hours, i'll have to do it only early next week.
Hi Rene,
We will be waiting for your response.
Hi,
I modified your example as much like my own solution as i could and i cant reproduce the error either… Since i'm now in version 15.1.7 i can at least give the error message i get in firebug. So here it is:
TypeError: c is undefined
var i=MVCx.getValueOfEditor(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"
in a DXR.axd file.
I know this isnt much. I will look further and hope you can give me a cue.
Thank you
Hello Rene,
Based on the provided code, I suppose that the issue is related to the grid's validation logic. Would you please provide us with the following details?
3. A screencast illustrating what steps cause the issue (for example, you can use the Jing Tool to capture it).
Thanks,
Artem
Hi,
public class CoitemLancementsMetadata
{
[Display(Name = "Lanc.")]
public short co_release { get; set; }
[Display(Name = "Qté")]
public decimal qty_ordered_conv { get; set; }
[Display(Name = "Échéance le")]
public DateTime? due_date { get; set; }
[Display(Name = "Appr. Client")]
public byte IsAttenteClient { get; set; }
[Display(Name = "MOQ Valide")]
public byte MOQIsValid { get; set; }
[Display(Name = "Prix Valide")]
public byte PrixIsValid { get; set; }
[Display(Name = "Confir. SAC")]
public byte IsPrixConfirmer { get; set; }
[Display(Name = "Dév. complété")]
public bool dev_complete { get; set; }
}
[MetadataType(typeof(CoitemLancementsMetadata))]
public partial class Coitem_Lancements_Result
{
public bool dev_complete => Convert.ToBoolean(1 - in_developement);
}
I'm Using JQuery 2.1.4 and microsoft.unobtrusive.validation 3.2.3
I'm using BundleConfig to include files. As you will see i'm using bootstrap. I removed it to see if it was the culprit, but it was not the case.
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/main").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/bootstrap.js",
"~/Scripts/site.js"
));
bundles.Add(new ScriptBundle("~/bundles/datepicker").Include("~/Scripts/bootstrap-datepicker.js", "~/Scripts/locales/bootstrap-datepicker.fr.js"));
bundles.Add(new ScriptBundle("~/bundles/chosen").Include("~/Scripts/chosen.jquery.js"));
bundles.Add(new ScriptBundle("~/bundles/validate").Include(
"~/Scripts/jquery.validate*",
"~/Scripts/jquery.unobtrusive-ajax.js"
));
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include("~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/knockout").Include("~/Scripts/knockout-{version}.js"));
bundles.Add(new StyleBundle("~/Content/main").Include(
"~/Content/bootstrap.css",
"~/Content/bootstrap.yeti.css",
"~/Content/Site.css",
"~/Content/Soucy.css"));
bundles.Add(new StyleBundle("~/Content/datepicker").Include("~/Content/bootstrap-datepicker3.css"));
bundles.Add(new StyleBundle("~/Content/chosen").Include("~/Content/chosen.css"));
BundleTable.EnableOptimizations = false;
}
}
And in layout page
…
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title</title>
@Html.DevExpress().GetStyleSheets(
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },
new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor },
new StyleSheet { ExtensionSuite = ExtensionSuite.GridView },
new StyleSheet { ExtensionSuite = ExtensionSuite.PivotGrid },
new StyleSheet { ExtensionSuite = ExtensionSuite.Chart },
new StyleSheet { ExtensionSuite = ExtensionSuite.Report },
new StyleSheet { ExtensionSuite = ExtensionSuite.Scheduler },
new StyleSheet { ExtensionSuite = ExtensionSuite.TreeList },
new StyleSheet { ExtensionSuite = ExtensionSuite.RichEdit },
new StyleSheet { ExtensionSuite = ExtensionSuite.Spreadsheet },
new StyleSheet { ExtensionSuite = ExtensionSuite.SpellChecker }
)
@Styles.Render("~/Content/main")
@RenderSection("Styles", required: false)
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/main")
@Scripts.Render("~/bundles/validate")
@Html.DevExpress().GetScripts(
new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
new Script { ExtensionSuite = ExtensionSuite.HtmlEditor },
new Script { ExtensionSuite = ExtensionSuite.GridView },
new Script { ExtensionSuite = ExtensionSuite.PivotGrid },
new Script { ExtensionSuite = ExtensionSuite.Editors },
new Script { ExtensionSuite = ExtensionSuite.Chart },
new Script { ExtensionSuite = ExtensionSuite.Report },
new Script { ExtensionSuite = ExtensionSuite.Scheduler },
new Script { ExtensionSuite = ExtensionSuite.TreeList },
new Script { ExtensionSuite = ExtensionSuite.RichEdit },
new Script { ExtensionSuite = ExtensionSuite.Spreadsheet },
new Script { ExtensionSuite = ExtensionSuite.SpellChecker }
)
<style>
body {
padding-top: 60px !important;
}
</style>
</head>
…
3 I included jing swf file and also the stack and most of the solution… Hope this works…
Here is also the modified version of your project that was closest to mine ( but working fine) in case you want to start from there
Hi Rene,
I've added additional scripts and styles from the original sample to the second one, but wasn't able to reproduce the issue (see the attached video). Would you please check the following?
Whether the problem is related to Splitter scripts. Try to comment all JavaScript code in the PaneResized, PaneExpanded, PaneCollapsed event handlers.
Whether the problem is related to Bootstrap. Try to remove Bootstrap scripts and check if the issue persists.
Whether the issue is browser-specific:
- Detailed information about the browser: make a screenshot of the "Help -> About …" dialog.
- Browser/Document mode settings - press the F12 key to invoke the Dev Toolbar (for the IE browser only).
I see that you are registering both custom scripts and ours with the embedRequiredClientLibraries option. Try to turn off this option and register the scripts as described at How to register DevExpress scripts with external client libraries that use jQuery
Let me know the results of these steps.
i found where the problem was related, if u look at my project files i sent u, the problem comes when i use an ajax form in the customer detail pane. Look at the "_CustomerDetailPartialForm.cshtml" file. As soom as i comment out the fields "RowPointer,ParentRowPointer, IsRegrouper and PriceConv" the error diseapear.
I worked hard :D on yout sample i reproduced the problem. Of course since i only wanted to reproduce my solution on your sample, the logic isnt pretty, but this should help out!!! Look at the "T299946MVC_Modified" zip file
btw i still did what you asked of me so here it goes:
Thanks for the update. I've reproduced the issue and passed it to our R&D team for further research. Please bear with us.