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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Custom Datasource Field Name

Thread ID:

Created:

Updated:

Platform:

Replies:

144105 Apr 18,2019 02:23 PM UTC Apr 23,2019 05:15 AM UTC ASP.NET MVC 3
loading
Tags: Spreadsheet
Unknown
Asked On April 18, 2019 02:23 PM UTC

Hello,

I have a spreadsheet with sheet bind from a datasource with the option 'FieldAsColumnHeader' set as true. The problem is that it always get the field name as it is in the datasource (ex.: I have a field called "ItemCode" and I would like it to show in the header as "Item Code"). Is there a way to customize the fields name that are shown in the header? It would help in the process of localization too.


Att,

Sangeetha Priya Murugan [Syncfusion]
Replied On April 19, 2019 04:45 PM UTC

  
Hi Erik, 
 
Thank you for using Syncfusion products.  
 
We have checked your requirement and your requirement can be achieved using “columns” property in sheets object. Please refer the below code example to achieve your requirement.  
 
[JS]  
<script>   
    var dataSource = [   
            { "ItemName""Casual Shoes", Quantity: 10, Price: "20", Amount: "200", Discount: "1", Profit: "10" },   
            //...   
    ];   
    $(function () {   
        $("#Spreadsheet").ejSpreadsheet({   
            columnWidth: 100,   
            sheets: [{   
                dataSource: dataSource, fieldAsColumnHeader: true,   
                columns: [   
                    { field'A'textItem Name },   
                    { field: 'C', text: 'Header2' },   
                    { field: 'E', text: 'Header3' },   
                ]   
            }],   
        });   
    });   
</script>   
For your convenience, we have prepared the sample based on your requirement. Please find the link below. 
 
 
Regards, 
Sangeetha M 


Unknown
Replied On April 22, 2019 01:03 PM UTC

Hi Sangeetha,

Thank you for the response. I did as in the example and it worked!


Att,

Vinoth Kumar Sundara Moorthy [Syncfusion]
Replied On April 23, 2019 05:15 AM UTC

Hi Erik, 
 
We are happy to hear that your reported issue has been resolved. Please feel free to contact us if you need any further assistance on Syncfusion components. 
 
Regards, 
Vinoth Kumar S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon