Is setCellValue not working?

Hi,

Does setCellValue not work when using RowTemplate?
setCellValue does not work in the subsequent source code, but setCellValue works if you delete the RowTemplate of cshtml.

<cshtml>
@(Html.EJS().Grid("Grid")
    .DataSource(Model)
    .RowTemplate("#rowtemplate")
    ...

<javascript>
$(function () {
    $.connection.signalrHub.client.listenInfo = function (data) {
        data = JSON.parse(data);
        var grid = document.getElementById("Grid").ej2_instances[0];
        grid.setCellValue(data["PrimaryKey"], "Column1", data["Column1"]);
        ...

I want to use a RowTemplate to change the style of the cell and update the cell dynamically.
I am using Syncfusion.EJ2.MVC5.17.4.0.51.
Is there any solution?

Regards,
Pylori.

3 Replies

RN Rahul Narayanasamy Syncfusion Team March 3, 2020 12:47 PM UTC

Hi Pylori,

Greetings from Syncfusion.

Query: Is setCellValue not working? I want to use a RowTemplate to change the style of the cell and update the cell dynamically.

We have validated your query and you want to update the row template cell values using setCellValue method of the Grid. By default, the editing operation is not supported while using the row template.

Please get back to us if you need further assistance.

Regards,
Rahul



PY Pylori March 4, 2020 02:21 AM UTC

Hi,

Thank you for your answer.
Now that I understand why I can't do editing, I looked for a solution.
I found information that editing operation is possible if it is ColumnTemplate.
Will setCellValue work if I use ColumnTemplate?

Regards,
Pylori. 



MS Manivel Sellamuthu Syncfusion Team March 4, 2020 11:03 AM UTC

Hi Pylori, 

Thanks for your update. 

Yes. setCellValue will work for the columnTemplate. For this field should be define for that(columnTemplate) column. 

Please get back to us, if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon