This is a migrated thread and some comments may be shown as answers.

Hide gridlines

7 Answers 536 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Hema
Top achievements
Rank 1
Hema asked on 03 Mar 2016, 08:22 PM
Is there a way to hide the grid lines in the Spreadsheet ( both in the empty cells and the cells that have some data)  ? I tried to set no borders and still gridlines appear . If I have a different fill ( like grey ) , still the lines appears , but it is lighter.

7 Answers, 1 is accepted

Sort by
0
Jared
Top achievements
Rank 1
answered on 04 Mar 2016, 03:12 PM

var spreadsheet = $("#spreadsheet");
var activeSheet = spreadsheet.activeSheet();
activeSheet.options.showGridLines = false;

 

client side

0
T. Tsonev
Telerik team
answered on 07 Mar 2016, 03:06 PM
Hello,

Thanks, Jared, you're absolutely right.

I see that this option is missing in the Spreadsheet API. Will add it right away.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
T. Tsonev
Telerik team
answered on 07 Mar 2016, 03:59 PM
Hello,

Perhaps I spoke a bit too soon. The option is currently accessible only when loading the spreadsheet from configuration or from external source (JSON, XLSX).
For example:
    <script>
        $("#spreadsheet").kendoSpreadsheet({
            sheets: [{
                name: "Food Order",
                            showGridLines: false,
                mergedCells: [
                    "A1:G1"
                ],
                rows: [{
                    height: 70,
                    cells: [{
                        value: "My Company", fontSize: 32, textAlign: "center"
                    }]
                }]
            }]
        });
    </script>


Changing it at run-time is not supported. For the next release, the Sheet will have a showGridLines method:
    var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
    var activeSheet = spreadsheet.activeSheet();
    activeSheet.showGridLines(false);


Note that the sheet.options.showGridLines field will be removed. It was not intended to be a part of the public API.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Hema
Top achievements
Rank 1
answered on 09 Mar 2016, 04:47 PM
I tried the showGridLines: false option . It doesn't remove any gridlines if there is no data. I want gridlines removed from the spreadsheet completely . Is there a way for that ?
0
T. Tsonev
Telerik team
answered on 11 Mar 2016, 03:21 PM
Hello,

Sorry, my bad. The provided samples only work against the latest builds for our next release.

For the current version, the code is a bit more involved. I've created a sample in the dojo.
      if (activeSheet.showGridLines) {
        // Kendo UI 2016.2 and beyond
        activeSheet.showGridLines(false);
      } else if (activeSheet.options) {
        // Kendo UI 2016.1
        activeSheet.batch(function() {
          activeSheet.options.showGridLines = false;
        }, { layout: true });
      }


Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Hema
Top achievements
Rank 1
answered on 14 Mar 2016, 09:29 PM

Tsonev,

I am using the Kendo version 2016.1.112 . I tried to call the showGridLines property and I got this error . Please advice.

TypeError: Cannot read property 'start' of undefined
    at e.support.browser.msie.e.support.browser.version.e.Class.extend.visible

Uncaught TypeError: Cannot read property 'start' of undefinede.support.browser.msie.e.support.browser.version.e.Class.extend.visible

Code snippet :

var sheet = spreadsheet.sheetByIndex(0);
sheet.fromJSON({
name : gridData.name,
frozenRows : gridData.frozenRows,
frozenColumns : gridData.frozenColumns,
rows : gridData.rows,
columns : gridData.columns
});// sheet json
if( sheet.options )
{
console.log("in sheet options ");
sheet.batch(function() {
sheet.options.showGridLines = false;
}, { layout: true });
}

 

Thanks,

Hema

0
T. Tsonev
Telerik team
answered on 17 Mar 2016, 08:54 AM
Hello,

Please accept my apologies for the delayed response.

I tried to reproduce the issue in the standalone example, but without luck.
Can you try upgrading to the latest version? 

The error is strange to begin with. Please check if you're not loading the Kendo UI scripts twice.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Spreadsheet
Asked by
Hema
Top achievements
Rank 1
Answers by
Jared
Top achievements
Rank 1
T. Tsonev
Telerik team
Hema
Top achievements
Rank 1
Share this question
or