I use Infragistics.Web.Mvc version 3.12.1.2023.
I define my igGrid in this way:
@( Html.Infragistics().Grid<BoletaDetalleView>().ID("igGridDetalle").PrimaryKey("Guid")
.Columns(column =>
{
column.For(x => x.Remuneracion).DataType("number").HeaderText("Remuneracion").Width("10%"); column.For(x => x.ImporteRetencion).DataType("number").HeaderText("Retencion").Width("10%"); column.For(x => x.Guid).DataType("string").HeaderText("GUID").Hidden(true);})
.Features(features =>{ features.Sorting().Mode(SortingMode.Single).ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("ApellidoNombre").AllowSorting(true);
}); features.Selection().MouseDragSelect(true).MultipleSelection(false).Mode(SelectionMode.Row);
features.Updating().EditMode(GridEditMode.Cell);
})
.ClientDataSourceType(ClientDataSourceType.JSON).DataSource(new List<BoletaDetalleView>().AsQueryable()).Width("100%").AutoCommit(true).DataBind().Render())
I want to calculate a value of cell "Retencion" when I change value of "Remuneracion" . I´m using this to do the job:
$("#igGridDetalle").live("iggridupdatingeditcellending", function (event, ui) {
if (!ui.editor) { return false; }
if (ui.columnKey === 'Remuneracion') { var myValue=123; var p= $("#igGridDetalle").igGrid("setCellValue", ui.rowID,'ImporteRetencion',myValue);return true;}
});
but the value of 'ImporteRetencion' never changes. Is there another way to do this?
Hi,
setCellValue is method of igGridUpdating. I guess that your mistake is that you're trying to execute setCellValue on igGrid insead of igGridUpdating.
Try this code for editCellEnding event:
Hope this helps,
Martin Pavlov
Infragistics, Inc.