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

How to determine if the selected range contains a merged cell?

2 Answers 357 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Junius
Top achievements
Rank 2
Junius asked on 27 Nov 2019, 01:21 AM

Hi there,

I found this post "Is a selected cell merged?" from the spreadsheet forums which is quite similar to what I want.

I have a kendo.ui.spreadsheet which the user selects a range of cell (including a merged cells).  From the post, it mentioned about "For a merged Cell the Property IsSingleCell is false", but I don't see a property definition of "IsSingleCell" in the spreadsheet API documentation. 

Where can I find this "IsSingleCell" property?  If this property exists, any dojo example would be awesome.

If not, is there a way to determine if the selected range in a spreadsheet contains a merged cell? 

I'm hoping that there will be a cell property like "merged" that returns true or false.

 

Any inputs is greatly appreciated.

Junius

2 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 28 Nov 2019, 02:47 PM

Hello Junius,

The linked thread is about the WPF RadSpreadsheet. The Kendo UI Spreadsheet is a different component. To check whether there is a merged cell in a given range, you can use the _mergedCells private property. It can be accessed like this:

var mergedCellsInRangeArray = sheet.range("A1:G1")._sheet._mergedCells;

It is an array and its length will return 0 if there are no merged cells in the range, otherwise it will contain objects with more information on the merged cells. 

See this dojo example, in which initially there is no merged cells and on pressing the button above the Spreadsheet a cell is merged, which is reflected in the  _mergedCells property value.


Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Junius
Top achievements
Rank 2
answered on 08 Apr 2020, 04:31 AM
Thank you for your response Ivan.  Your answer is really helpful.
Tags
Spreadsheet
Asked by
Junius
Top achievements
Rank 2
Answers by
Ivan Danchev
Telerik team
Junius
Top achievements
Rank 2
Share this question
or