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

3 posts, 0 answers
  1. Junius
    Junius avatar
    18 posts
    Member since:
    Apr 2018

    Posted 26 Nov 2019 Link to this post

    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. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2086 posts

    Posted 28 Nov 2019 Link to this post

    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.
  3. Junius
    Junius avatar
    18 posts
    Member since:
    Apr 2018

    Posted 07 Apr in reply to Ivan Danchev Link to this post

    Thank you for your response Ivan.  Your answer is really helpful.
Back to Top