Hello!
I have an igGrid and has 1 column that was configured with updating feature
Can you give me an example to change from texteditor to combo editor
Because with each row. I want to fill data with each other editor type
i used infragistics 15.2
Hello Cuong,
I assume you want to change the editor at runtime, based on some condition, right? To change the editor at runtime you need to change the columnSettings option like this:
$("#grid1").igGridUpdating("option", "columnSettings", [{columnKey: "col2", editorType: "combo", editorOptions: {dataSource: ["value1", "value2", "value3"]}}]);
You can do this in the igGridUpdating.editRowStarting event with the following code:
$("#grid1").on("iggridupdatingeditrowstarting", function (evt, ui) { // some condition to decide which editor to use for the row if (ui.rowID === 2) { $("#grid1").igGridUpdating("option", "columnSettings", [{columnKey: "col2", editorType: "combo", editorOptions: {dataSource: ["value1", "value2", "value3"]}}]); } else { $("#grid1").igGridUpdating("option", "columnSettings", [{columnKey: "col2", editorType: "text"}]); } // manually starting edit, because editRowStarting event fires at time which is too late to change editor types setTimeout(function () { $("#grid1").igGridUpdating("startEdit", ui.rowID); }, 100); return false; });
Hope this helps, Martin Pavlov Infragistics, Inc.
Hi Martin,
I would like to have similar code in .NET MVC . i am currently using igGrid like -
x.ColumnSetting().ColumnKey("Response").EditorType(ColumnEditorType.Combo) .ComboEditorOptions(co => co.DataSource(Model.List_Response).ValueKey("Value").TextKey("Text").Mode(ComboMode.DropDown));
In above scenario how should i put multiple data source ?
thank you very much.
i have an other question.
can i show more than 1 column with combo editor within igGrid
thank you very much!