I'm trying to restrict the decimals of the numeric field "orden" in child grid. Currently, I have the field "Orden" in the parent grid and it doesnt have decimal positions which is correct. But I want to do so in the child grid for its own "Orden" field but I dont know how.
Probably it is very similar with the instructions: ValidateDecimalOnType = true, Decimals = 0, Format = "N"...... but I don´t know exactly how.
@{
ViewData["Title"] = "Catálogo de coberturas póliza hogar";
Layout = "~/Areas/Sistema/Views/Shared/_Layout.cshtml";
}
<h2>Catálogo de coberturas póliza hogar</h2>
@{
var dataManager2 = new Syncfusion.EJ2.DataManager()
{
Adaptor = "UrlAdaptor",
Url = "/Sistema/Catalogos/coberturasCategoriasHogarGrid_Read/ ",
CrudUrl = "/Sistema/Catalogos/coberturasCategoriasHogarGrid_CRUD/ ",
RequestType = "Post",
CrossDomain = true
};
var childGrid = new Syncfusion.EJ2.Grids.Grid()
{
DataSource = dataManager2,
QueryString = "categoriaID",
Toolbar = new List<string>() { "Cancel", "Update", "Add", "Delete" },
EditSettings = new Syncfusion.EJ2.Grids.GridEditSettings()
{
AllowAdding = true,
AllowEditing = true,
AllowDeleting = true
},
Columns = new List<Syncfusion.EJ2.Grids.GridColumn>
{
new Syncfusion.EJ2.Grids.GridColumn(){ Field = "coberturaID", HeaderText = "coberturaID", Visible = false, Id = "categoriaID", IsPrimaryKey = true },
new Syncfusion.EJ2.Grids.GridColumn(){ Field = "categoriaID", HeaderText = "categoriaID", Visible = false, Id = "categoriaID" },
new Syncfusion.EJ2.Grids.GridColumn(){ Field = "nombreCobertura", HeaderText = "Nombre Cobertura"},
new Syncfusion.EJ2.Grids.GridColumn(){ Field = "orden", HeaderText = "orden"}
},
ActionBegin = "actionBegin"
};
}
@*childGrid="childGrid"*@
<ejs-grid id="coberturasHogarGrid" childGrid="childGrid" toolbar="@(new List<string>() { "Cancel", "Update", "Add", "Delete" })">
<e-data-manager id="dataManager" adaptor="UrlAdaptor" url="/Sistema/Catalogos/coberturasHogarGrid_Read" crudUrl="/Sistema/Catalogos/coberturasHogarGrid_CRUD" requestType="Post"></e-data-manager>
<e-grid-editSettings allowDeleting="true" allowEditing="true" allowAdding="true" mode="Normal" showDeleteConfirmDialog="true"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="categoriaID" isPrimaryKey="true" isIdentity="true" visible="false"></e-grid-column>
<e-grid-column field="nombreCategoria" headerText="Nombre de la categoría" visible="true"></e-grid-column>
<e-grid-column field="orden" headerText="Orden" visible="true" editType="numericedit" format="N" edit="@(new { @params = new Syncfusion.EJ2.Inputs.NumericTextBox() {
ValidateDecimalOnType = true,
Decimals = 0,
Format = "N"
}
})" ></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script>
function actionBegin(args) {
if (args.requestType === "save") {
this.query.params = [];
this.query.addParams('categoriaID', this.parentDetails.parentRowData.categoriaID);
}
}
</script>