Edit cell of dynamic column

Hi,

I have created a  grid column dynamically using the following code.

gridobj.columns([{ headerText: "Edit Grade", editType: ej.Grid.EditingType.Dropdown, editParams: { targetID: "AWLgradesList" } }]);
And, in recordClick event of the grid, i want to edit the cell.

Record Click function:
function editGrade(args)
        {
            var gridobj = $("#AWLGrid").data("ejGrid");
            if (args.cellIndex == 5)
            {
                gridobj.editCell(args.rowIndex, "Edit Grade");
            }
            
        }
Can you give me a workaround for this.

1 Reply

RU Ragavee U S Syncfusion Team December 16, 2016 10:12 AM UTC

Hi Indrani, 

From your code examples, we found that you have dynamically bound a column to the Grid. As, the newly added column doesn’t have the field property defined, it is not possible to edit the column value. 


The fieldname should be passed as a parameter for the column. 

Regards, 
Ragavee U S. 


Loader.
Up arrow icon