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
close icon

Can we save the Spreadsheet Data as the Model with which we have loaded the Spreadsheet in the first place.

Team, 

We have a requirement to show the data as Spreadsheet on Web Browser and user can edit it and save the changes. Then the Data should be saved back to the Data table or Model with which the Spread sheet was loaded on the first place. Can we achieve this functionality using ASP.NET MVC Spreadsheet control. Can you provide me sample code for saving back the Spreadsheet  data to the Data table or the model with which we have loaded the spreadsheet.

I am doing a POC on this control to check whether this is suitable for our project or not. So answer to below questions are very helpful for us to make a decision.

1. Can we hide/show only few menu options.
2. Can we Disable some features. For example we do not want the user to delete the complete column or Rearrange the order of columns.
3. Can we do the Saving Asynchronously.



Thanks for your help in advance!
Rajesh

11 Replies

SI Silambarasan I Syncfusion Team February 15, 2018 11:20 AM UTC

Hi Rajesh, 
 
Thank you for using Syncfusion products. 
 
We would like to let you know that your requirement ‘Load model data and save edited values back – MVC Spreasdheet’ has been achieved by using ‘Datasource’ API and ‘XLEdit.saveEditingValue()’ client-side method in Spreadsheet. We have prepared a sample to demonstrate this and the same can be downloaded from the below sample link. 
 
 
Help DOC: 
 
#1 Can we hide/show only few menu options 
 
Using ‘XLCMenu.hideItem()’ & ‘XLCMenu.showItem()’ client-side methods, we can hide/show context menu options based on its index value in Spreadsheet. Please refer the below code example. 
 
 
//To hide context menu option based on index value. 
this.XLCMenu.hideItem(ej.Spreadsheet.ContextMenu.Cell, [1, 2, 3, 8, 16, 21]);  
 
//To show context menu option based on index value. 
this.XLCMenu.showItem(ej.Spreadsheet.ContextMenu.Cell, [21]); //21 index => Format Cells 
 
 
API links: 
 
#2 Can we Disable some features. For example, we do not want the user to delete the complete column or Rearrange the order of columns. 
 
Using provided Spreadsheet API’s, we can enable/disable the needed features that you want in Spreadsheet. Please refer the below code example for disable the delete feature. 
 
 
@(Html.EJ().Spreadsheet<object>("Spreadsheet") 
    .AllowDelete(false) //Disable Delete feature 
    //... 
) 
 
 
API links: 
 
#3 Can we do the Saving Asynchronously. 
 
In the above provided sample, we have saved the modified values by using AJAX post on external button click and its saved & pass the cell values in asynchronous manner. Could you please check the above sample and get back to us if we misunderstood your requirement or need further assistance? 
 
Regards, 
Silambarasan 



RK rajesh kandepu February 16, 2018 05:28 PM UTC

Hai, 

Thank you for the quick reply on this. I have more question regarding this.Can we completely hide the Menu options ribbon so that We can see only search bar and columns and rows.

The attached pic shows what we want to hide. Is it possible to achieve this using ASP.NET MVC Spreadsheet control.

Thanks!
Rajesh


RK rajesh kandepu February 16, 2018 07:12 PM UTC

Hai, 

Sorry for more questions. Can we add drop down list in a cell(from datasource) and user can select a value and based on selected value, can we auto fill the a range of cells in the column.
If this is possible, can you please send me the sample.

Thanks!
Rajesh


SI Silambarasan I Syncfusion Team February 19, 2018 07:34 AM UTC

Hi Rajesh, 
 
Thanks for your update. 
 
Query #1 “Can we completely hide the Menu options ribbon so that We can see only search bar and columns and rows.” 
 
Your requirement for hide the ribbon option can be achievable by using ‘ShowRibbon’ API to set as false in Spreadsheet. Please refer the below code example. 
 
 
@(Html.EJ().Spreadsheet<object>("Spreadsheet") 
    .ShowRibbon(false) //To hide Ribbon         
    //... 
) 
 
 
 
Query #2 “The attached pic shows what we want to hide. Is it possible to achieve this using ASP.NET MVC Spreadsheet control.” 
 
We have checked this query and we would like to let you know that we couldn’t find any attachment which represent your requirement for about hide. So, could you please check this and get back to us with that attachment or provide more information to procced further? 
 
Meanwhile, please check the below API links and get back to us with the details whether this requirement can be achievable or not. 
 
 
Query #3 “Can we add drop down list in a cell(from datasource) and user can select a value and based on selected value, can we auto fill the a range of cells in the column.” 
 
Yes. Your requirement can be achievable in Spreadsheet by using ‘XLCellTypes.addCellTypes()’ client-side method to add dropdownlist with custom datasource and using ‘XLDragFill.autoFill()’ to fill the data in specified cell range. Please refer the below code example. 
 
 
@(Html.EJ().Spreadsheet<object>("Spreadsheet") 
    //... 
    .ClientSideEvents(eve => eve.LoadComplete("onLoadComplete").CellSave("onCellSave")) 
) 
 
 
var ddData = [{ text: "C5:C15", value: "C3:C4" } , ...]; 
 
function onLoadComplete(args) { 
    if (!this.isImport) { 
        //... 
        this.XLCellType.addCellTypes("A3", { 'type': ej.Spreadsheet.CustomCellType.DropDownList, 'dataSource': ddData, 'field': 'text' }); 
         
    } 
} 
 
function onCellSave(args) { 
    if (args.selectedText && args.selectedValue) { 
 
        this.XLDragFill.autoFill({ 
            dataRange: args.selectedValue, 
            fillRange: args.selectedText, 
            direction: ej.Spreadsheet.autoFillDirection.Down, 
            fillType: ej.Spreadsheet.AutoFillOptions.FillSeries, 
            isKeyFill: true 
        }); 
    } 
} 
 
 
For your convenience, we have modified the provided sample to demonstrate these requirements and the same can be downloaded from the below link, 
 
Could you please check the above sample and let us know whether is this fulfilling your requirement, if not please share us more information regarding this so that we can analyze based on that and provide you a better solution. 
 
Regards, 
Silambarasan 



RK rajesh kandepu February 19, 2018 04:45 PM UTC

Hai, 

Thanks for the quick reply again. One final question.

Can this control has search functionality?

Thanks!
Rajesh


SI Silambarasan I Syncfusion Team February 20, 2018 09:26 AM UTC

Hi Rajesh, 
 
Thanks for your update. 
 
We would like to let you know that, the support for searching functionality is available in Spreadsheet. Using ‘AllowSearching’ API, you can enable or disable this feature. 
 
 
Please check the above help documentation links and get back to us if you need further assistance. 
 
Regards, 
Silambarasan 



RK rajesh kandepu February 20, 2018 11:56 PM UTC

Team, 

Thanks for the quick reply again. When I see the pricing options for this Individual Component, I see 995 for 1 developer. How many deployment servers it is valid for?

Thanks!
Rajesh


ST SaBrena Toler Syncfusion Team February 21, 2018 02:22 PM UTC

Hello Rajesh, 

We thank you for your interest in our controls.  I have forwarded your inquiry to our Sales Department; one of our team members will contact you shortly. 

Please let me know if you have any questions. 

Best, 
SaBrena 



RK rajesh kandepu February 21, 2018 10:22 PM UTC

Hai, 

Thanks. A Sales Rep contacted me. We are going to buy this control ASAP. I have one question. I am trying to load the Spreadsheet when a button was clicked and trying to load the JSON and I keep getting this error. Can you tell what I am missing here. I am following the API documentation. Below is the code snippet.

 success: function (data) {
                var ssObj = $("#Spreadsheet").data("ejSpreadsheet");                              
                console.log(ssObj);                
                ssObj.loadFromJSON(data);
                ssObj.refreshSpreadsheet();
            }

And here is the Error I keep getting. 



The requirement I have is to load the Spreadsheet when User selects some options from drop down an click submit. SO the spreadsheet will not get loaded as soon as the APP runs. Can you suggest me good options for initializing the Spreadsheet with this requirement.

Thanks for your help!
Rajesh




RK rajesh kandepu February 22, 2018 09:22 PM UTC

Hai, 

We are just holding off buying this control until we get the clarification on the issue I have sent before. Sorry to bug you but my manager wants the working demo app with this requirement before buying the control.

The basic requirement we have is , we have a bunch of drop down lists and text boxes on our web page and user can select options from drop down list and and based on the selected options, we need to load the spread sheet with data(Just like SSRS Reports). I have already constructed my model and an AJAX function that returns the JSON out of these model. So when user submits to get the data, this AJAX function returns data in JSON format and we need to load the Spreadsheet with this JSON data. Can you let me know how we can achieve this. And the spreadsheet will refreshed with new data every time user press submit. I have checked the entire API documentation, but could not find any similar one to my requirement. I though the below API is the one, but apparently that is for a different purpose.

var excelObj = $("#Spreadsheet").data("ejSpreadsheet"), response;
response = excelObj.saveAsJSON();
excelObj.loadFromJSON(response);
Can you please suggest me best options on it and if possible sample application. Also I have tried using this in a partial view and loaded the view in the parent view, but it is displaying nothing..
Is this compatible to work with partial views?
Thanks!
Rajesh




ST SaBrena Toler Syncfusion Team February 22, 2018 09:26 PM UTC

Hello Rajesh, 
I have forwarded your inquiry to our Sales Engineer team.  Someone will contact you shortly. 
  
Best,
SaBrena 


Loader.
Live Chat Icon For mobile
Up arrow icon