We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Changes to Spreadsheet.Sheets not updating

HiRahul,

We have resolved theRichTextEditorcomponent reportedissue “Unwanted question mark coming while using the tools present in the rich text editor” and included in17.2.51patch release.

We suggest you upgrade theej2-angular-richtexteditorpackage into latest version to resolve the issues.


Regards,
Pandiyaraj M



3 Replies

SI Silambarasan I Syncfusion Team February 19, 2019 06:35 AM UTC

Hi Hasindu, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported requirement “Using Cell databinding, to access the spreadsheet’s updated data at server side” and as per our current implementation behavior, your requirement to access the data in server side is not feasible while using cell data binding.  
 
However, we would suggest you to bind dataSource by using ‘Datasource’ or ‘RangeSettings property in Spreadsheet. And, we have provided ‘onSeverCellSaveserver-side event for cell save which triggers in server side while on saving the edited cell value. Using this event, you can get the modified cell value in server-side on every cell save. Please refer the below demo sample for more details. 
 
Server Side Save Event: 
 
Please refer the below help documentation link for about databinding in Spreadsheet: 
 
Could you please check the above information and get back to us if you need further assistance on this? 
 
Regards, 
Silambarasan 



HA Hasindu February 21, 2019 08:18 PM UTC

Hi Syncfusion,


I've worked on your codes and now it's working
I selected onSeverCellSave method to implement.



    Protected Sub Spreadsheet_ServerCellSave(ByVal sender As Object, ByVal e As SpreadsheetEventArgs)

        Dim KeyVal As Dictionary(Of String, Object) = TryCast(e.Arguments, Dictionary(Of String, Object))

        If e.EventType = "cellSave" Then
            Dim rowIdx = Convert.ToInt32(KeyVal("rowIndex"))
            Dim colIdx = Convert.ToInt32(KeyVal("colIndex"))
            Dim value = KeyVal("value")

            Sheet1 = FlatSpreadsheet.Sheets(0)
            Sheet1.Rows(rowIdx).Cells(colIdx).Value = value
            FlatSpreadsheet.Sheets(0) = Sheet1

        Else
        End If

        ViewState("DataSource") = DS
        serverEvent.InnerHtml = serverEvent.InnerHtml & span & "cell Save event called
"
    End Sub


But now, Client has to PostBack each time when changing a cell. It creates a lag even when UpdatePanels are there.
So, How to avoid this lag?
Is there a way to "Bulk update Cell changes" ?
How to restore Spreadsheet scroll and selected cell after a postback happens?
Is there any "sily things" done in above code?
How to avoid fill handler errors when using onSeverCellSave  (Spreadsheet_ServerCellSave only recieve the formulas of first and last cells. Others are evaluated values!)

Thanks for these quick responses.



SI Silambarasan I Syncfusion Team February 23, 2019 05:01 AM UTC

Hi Hasindu, 
 
Thanks for your update. 
 
We have checked your reported requirements and we would let you know that as we stated in our previous update “onServerCellSave” event called while saving the each cell. So, we would suggest you to update the bulk edited data to the server side, by using the client side “saveEditingValue” method.  
 
For your convenience, we have prepared a sample that bind the datasource using rangeSettings property and get the bulk edited data (updated datasource) in the serverside using client-side button click event as like in the below code example. 
 
CSHTML: 
 
<input type="button" value="Save Changes to Server" id="saveChangesToServer" /> 
 
 <ej:Spreadsheet ID="Spreadsheet1" runat="server"> 
    <ClientSideEvents LoadComplete="loadComplete" OpenFailure="openfailure" /> 
    <ScrollSettings Width="100%" Height="470" IsResponsive="true" /> 
    <Sheets> 
                 <ej:Sheet> 
                            <RangeSettings> 
                                <ej:RangeSetting ShowHeader="false" /> 
                            </RangeSettings> 
                        </ej:Sheet> 
                    </Sheets> 
</ej:Spreadsheet> 
 
 
<script type="text/javascript"> 
$("#saveChangesToServer").on("click", function () { 
//To get the bulk edited data in server side. 
    var ssObj = $("#MainContent_Spreadsheet1").data("ejSpreadsheet"), key, rowIdx, sheetIdx = ssObj.getActiveSheetIndex(), editedChanges = ssObj.XLEdit.saveEditingValue().EditedData, 
        dataSettings = ssObj.getDataSettings(sheetIdx)[0], isShowHeader = dataSettings.showHeader, dataSource = dataSettings.dataSource, changedDataSource = [], pushedRowColl = []; 
    activeCell = ssObj.getActiveCell(sheetIdx); // To get the activeCell for scrolling after post back 
    if (!editedChanges.length) { 
    ssObj.alert ("Please edit any cells and try again!"); 
    return; 
    } 
    for (key in editedChanges) { 
    rowIdx = editedChanges[key].CellIndex.RowIndex; 
    if (isShowHeader) 
        rowIdx--; 
    if (pushedRowColl.indexOf(rowIdx) < 0) { 
        changedDataSource.push(dataSource[rowIdx]); // To get the changed data source. 
        pushedRowColl.push(rowIdx); 
    } 
    } 
    $.ajax({ 
        type: "POST", 
        url: "SpreadsheetFeatures.aspx/Spreadsheet1_ServerCellSave", 
        data: JSON.stringify({ editedValues: JSON.stringify(changedDataSource) }), 
        contentType: "application/json; charset=utf-8", 
        dataType: "json", 
        success: function (response) { 
            // Success code here 
        }, 
        error: function (err) { 
            // Error code here 
        } 
    }); 
 
}); 
</script> 
 
CONTROLLER: 
 
         <WebMethod> 
    Public Shared Function Spreadsheet1_ServerCellSave(ByVal editedValues As String) As String 
        Dim serialize As JavaScriptSerializer = New JavaScriptSerializer() 
        Dim editedData As List(Of Orders) = serialize.Deserialize(Of List(Of Orders))(editedValues) // get the updated datasource 
        SpreadsheetObj.Sheets(0).RangeSetting(0).Datasource = editedData         Return "Successfully updated" 
    End Function 
Meanwhile to scroll the selected cell after postback also can be achievable by using the “scrollToCell” method in loadComplete event. The active cellIndex is saved in the activeCell variable before postback is done in button click event and it can be demonstated in the below code example. 
 
CONTROLLER: 
 
var activeCell = { rowIndex: 0, colIndex: 0 }; 
 
function loadComplete(args) { 
            var xlFormat = this.XLFormat; 
            if (!this.isImport) { 
               this.XLScroll.scrollToCell([activeCell.rowIndex,activeCell.colIndex,activeCell.rowIndex,activeCell.colIndex])   // To scroll the last updated cell. 
            } 
        } 
 
 
Could you please check the above sample and get back to us if you need any further assistance on this? 
 
Regards, 
Silambarasan 


Loader.
Live Chat Icon For mobile
Up arrow icon