@(Html.Infragistics() .Grid(Model.HtmlOrderItems) .ID("grid") //.Height("120%") .Width("100%") .AutoGenerateColumns(false) .AutoGenerateLayouts(false) .RenderCheckboxes(true) .LocalSchemaTransform(true) .PrimaryKey("oitemsid") .Columns(column => { column.For(x => x.oitemsid).Hidden(true).HeaderText("OID");
column.For(x => x.childOutterHtmlstart).HeaderText("Outer HTML").Width("*"); column.For(x => x.LinkOuterInnerHtml).HeaderText("Link OuterInner").Width("*"); column.For(x => x.RepeatStrategy).HeaderText("RepeatStrategy").Width("*");
}) .Features(features => { features.Selection().Mode(SelectionMode.Row).MultipleSelection(false).Activation(true); //features.Sorting().Type(OpType.Local); // features.Paging().Type(OpType.Local); //features.Filtering().Type(OpType.Local); features.RowSelectors().RequireSelection(true).EnableRowNumbering(true); features.Hiding(); // features.RowSelectors().RequireSelection(true); features.Updating() .EditMode(GridEditMode.Row) .EnableDeleteRow(true) .EnableAddRow(true) .ColumnSettings(cs => {
cs.ColumnSetting().ColumnKey("childOutterHtmlstart").EditorType(ColumnEditorType.Text); cs.ColumnSetting().ColumnKey("LinkOuterInnerHtml").EditorType(ColumnEditorType.Checkbox).DefaultValue(0); cs.ColumnSetting().ColumnKey("RgxOuterHtmlFilter").EditorType(ColumnEditorType.Text);
});
})
.DataSourceUrl(Url.Content("page1?locationid=" + Model.LocationId)) .UpdateUrl("page2?locationid=" + Model.LocationId + "&clientid=" + Model.ClientId)
.Render() )
The issue it on Column "childOutterHtmlstart".
childOutterHtmlstart value is = Coming from SQL Server as a VarchChar(350)
<div style='position:absolute;left:69px;|<div style='position:absolute;left:71px;|<div style='position:absolute;left:72px;
If I change the value down to <div style='position:absolute;left:69px;|<div style='position:absolute;left:71px;|<div style someithing about that 3rd = that is causing the issue.
Is there a setting that I can change this field to, to get around the error?
Hello Danny,
Thank you for posting in our forum.
I tried to reproduce this issue by creating an isolated MVC sample that I could run on my side when testing – I have used the initialization configuration you have provided and Ignite UI 18.2 (is this the version that you use as well?). I was not able to get this error message and reproduce the problem you describe.
Please try running the provided file attachment on your side (it contains the MVC project) and check if the error message would appear? If it does not – please feel free to modify the sample until the behavior reproduces, then send it back to me so I could debug and get to the root cause of the issue. Or send another isolated sample, in case you have one.
Does the error message appear immediately after the grid has been initialized, or only after some specific action has been performed by the user and is it possible for to provide the whole stack trace?
I would appreciate if you please elaborate some more on this <div> element you describe, as I am not sure which one you refer to, and where do you change its value?
Danny Kraatz said:<div style="position:absolute;left:69px;|<div style="position:absolute;left:71px;|<div style="position:absolute;left:72px;
gridRemoteFeatures.zip
Yes it is still Throwing the error. The error happens when you try to update the field or Row.
<div style="position:absolute;left:69px;|<div style="position:absolute;left:71px;|<div style="position:absolute;left:72px;
The Above div is stored as a string in the Database, then is fed to the grid over Json.
I am still not able to get this error – the only error I do get is when I try to add a new row:
Uncaught Error: igCheckboxEditor requires a different value. A boolean value should be provided
This happens because in the initialization configuration the default value for the checkbox editor is zero, but it expects a value of true or false. You might want to change that in your code as well.
When I try pasting the string from your last response, ( <div style="position:absolute;left:69px;|<div style="position:absolute;left:71px;|<div style="position:absolute;left:72px;) the cell does get updated, but it looks empty. The reason for this is the following: the Updating feature sets the HTML string as a cell value and the browser adds it to the DOM, but if the string is incorrect, it gets discarded – hence you get an empty <td> element. You could easily verify this as well, by adding an empty <span></span> or <div></div> element and if you inspect the <td> element you would see it actually contains the <span> or <div>.
Do you use some other JavaScript code somewhere in your application that might be looking for the column format, for example a formatter function somewhere in the View?