hi, i try to create cascade combos but i cant AddClientEvent to ComboEditorOptions here my code
@(Html.Infragistics() .Grid(Model.Pisos) .ID("grdMenu") .LoadOnDemand(false) .AutoGenerateColumns(false) .PrimaryKey("IdPiso") .AutoGenerateLayouts(false) .AutoCommit(true) .Columns(cols => { cols.For(x => x.IdPiso).Width("25%").HeaderText("Level"); cols.For(x => x.DescPiso).Width("25%").HeaderText("Description"); cols.For(x => x.IdTypeComposition).Width("25%").HeaderText("TypeComposition").FormatterFunction("lookupType"); cols.For(x => x.IdFormato).Width("25%").HeaderText("UPCFormat").FormatterFunction("lookupUPC"); //cols.For(x => x.FormatoUPC).Width("25%").HeaderText("UPCFormat"); cols.For(x => x.Bunches).Width("25%").HeaderText("Bunches"); }) .ColumnLayouts(layouts => { layouts.For(x => x.Composition) .PrimaryKey("IdProduct") .ForeignKey("IdPiso") .AutoGenerateColumns(false) .Features(feature => { feature.MultiColumnHeaders(); }) .Columns(childcols1 => { childcols1.MultiColumnHeader().HeaderText("Composition").Group(c => { c.For(x => x.Product).HeaderText("Product"); c.For(x => x.Variety).HeaderText("Variety"); c.For(x => x.Grade).HeaderText("Grade"); c.For(x => x.Stems).HeaderText("Stems"); }); }); layouts.For(x => x.Material) .PrimaryKey("IdMaterial") .ForeignKey("IdPiso") .AutoGenerateColumns(false) .Features(feature => { feature.MultiColumnHeaders(); feature.Updating() .AddRowLabel("New Level") .AddClientEvent("selectionChanged", "EditCell") .ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("Tipo").EditorType(ColumnEditorType.Combo).Required(true).ComboEditorOptions(co => co.ID("grdcbTipo").DataSource("/NewFinalProd/getMaterial").ValueKey("codsub").TextKey("nomsub").Mode(ComboMode.DropDown).EnableClearButton(false).AddClientEvent("selectionChanged", "loadDescription")); settings.ColumnSetting().ColumnKey("Description").EditorType(ColumnEditorType.Combo).Required(true).ComboEditorOptions(co => co.ID("grdcbMaterial").DataSource("/NewFinalProd/getMaterial").ValueKey("codsub").TextKey("nomsub").Mode(ComboMode.DropDown).EnableClearButton(false)); }) .EnableAddRow(true) .EnableDeleteRow(false) .EditMode(GridEditMode.Row) .ShowReadonlyEditors(false); }) .Columns(childcols2 => { childcols2.MultiColumnHeader().HeaderText("Material").Group(c => { c.For(x => x.Tipo).HeaderText("Type"); c.For(x => x.Descripcion).HeaderText("Description"); c.For(x => x.Cantidad).HeaderText("Quantity"); }); });
}) .Features(feature => { feature.MultiColumnHeaders(); feature.Updating() .AddRowLabel("New Level") .AddClientEvent("editRowEnded", "bridgeEditRow") .ColumnSettings(settings => { settings.ColumnSetting().ColumnKey("IdPiso").ReadOnly(true); settings.ColumnSetting().ColumnKey("IdTypeComposition").EditorType(ColumnEditorType.Combo).Required(true).ComboEditorOptions(co => co.DataSource(ViewBag.lstType).ValueKey("IdTypeComposition").TextKey("NameCoposition").Mode(ComboMode.DropDown).EnableClearButton(false)); settings.ColumnSetting().ColumnKey("IdFormato").EditorType(ColumnEditorType.Combo).Required(true).ComboEditorOptions(co => co.DataSource(ViewBag.lstUPC).ValueKey("IDFormato").TextKey("Formato").Mode(ComboMode.DropDown).EnableClearButton(false)); }) .EnableAddRow(true) .EnableDeleteRow(false) .EditMode(GridEditMode.Row) .ShowReadonlyEditors(false); }) .Width("100%") .DataSourceUrl(Url.Action("GetFinalproductPisosByIdFinalProd")) .DataBind().Render())
tanks Michael for you help , i will try this option ...
can made other question?
in the gHierarchicalGrid, how make a column formater function?
in the igGrid i make this function, but i know how implement in the gHierarchicalGrid.
var TypeLookup = [], UPCLookup = [], loadingIndicator; $(function () { var grid = $("#grdMenuE"), comboDataSource = {}; comboDataSource = grid.data("igGridUpdating").options.columnSettings[1].editorOptions.dataSource; for (var i = 0; i < comboDataSource.length; i++) { TypeLookup[comboDataSource[i].IdTypeComposition] = comboDataSource[i]; } comboDataSource = grid.data("igGridUpdating").options.columnSettings[2].editorOptions.dataSource; for (var i = 0; i < comboDataSource.length; i++) { UPCLookup[comboDataSource[i].IDFormato] = comboDataSource[i]; } });
function lookupType(id) { return TypeLookup[id].NameCoposition; }
function lookupUPC(id) { if (UPCLookup.length > 1) { if (id != null) return UPCLookup[id].Formato; } }
tanks.
Hi Jorge,
In Ignite UI 15.1, we used an older version of the igCombo for the editor and AddClientEvent is not available.
Instead, you will need to set up the selectionChanged event through javascript. I have provided some code below to show how you can achieve this using the EditorOptions property instead of the ComboEditorOptions.
cshtml:
settings.ColumnSetting().ColumnKey("Tipo").EditorType(ColumnEditorType.Combo).Required(true).EditorOptions("id: 'grdcbTipo', dataSource: '/NewFinalProd/getMaterial', valueKey: 'codsub', textKey: 'nomsub', mode: 'dropdown', enableClearButton: false");
javascript code:
$(function () { $(document).on("igcomboselectionchanged", "#grdcbTipo", loadDescription);});
If you need further assistance with this, please let me know and I will be glad to help.
C:\Program Files (x86)\Infragistics\2015.1\Ignite UI\MVC\MVC5\Bin\Infragistics.Web.Mvc.dll
version : 5.15.1.2410
Thank you for the information.
Please tell me what version of the Infragistics.Web.Mvc.dll you are referencing in your project.
Looking forward to hearing from you.
hi, thanks for your help,
if i run the visual i get this error:
'Infragistics.Web.Mvc.ColumnUpdatingComboEditorOptionsWrapper' does not contain a definition for 'AddClientEvent' and no extension method 'AddClientEvent' accepting a first argument of type 'Infragistics.Web.Mvc.ColumnUpdatingComboEditorOptionsWrapper' could be found (are you missing a using directive or an assembly reference?)