Incorrect index returned in GridColumnResizeEvent

4 posts, 1 answers
  1. Devender
    Devender avatar
    4 posts
    Member since:
    May 2020

    Posted 06 Jul 2020 Link to this post

    I have a master-detail grid and I've enabled column resizing.

    I've noticed that when a column resize event is triggered on the master grid (i.e. the one that contains the expand/collapse HierarchyCells), the index field returned from this event is out by 1 when compared to the columns field in the same event. The index is too large by 1.

    When a column resize event is triggered on a grid that does not contain HierarchyCells, the index field returned is correct.

    In the attached files, you'll see the address1 column was resized, however, an index of 5 was returned instead of 4. 

  2. Devender
    Devender avatar
    4 posts
    Member since:
    May 2020

    Posted 06 Jul 2020 in reply to Devender Link to this post

    Is there a way to detect if the grid contains Hierarchy cells from the GridColumnResizeEvent?
  3. Answer
    Stefan
    Admin
    Stefan avatar
    3034 posts

    Posted 07 Jul 2020 Link to this post

    Hello, Devender,

    This occurs as the expand/collapsed column is actually on index 0 moving all other columns by 1.

    We can detect that inside the onColumnResize event by checking if the Grid has an expandField and detail props as this should indicate that we do have a expand/collapse column:

    https://stackblitz.com/edit/react-pguv9f?file=app%2Fmain.jsx

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  4. Devender
    Devender avatar
    4 posts
    Member since:
    May 2020

    Posted 07 Jul 2020 in reply to Stefan Link to this post

    That did the trick. Thank you.
Back to Top