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

Incorrect index returned in GridColumnResizeEvent

3 Answers 16 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Devender
Top achievements
Rank 1
Devender asked on 06 Jul 2020, 03:29 PM

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. 

3 Answers, 1 is accepted

Sort by
0
Devender
Top achievements
Rank 1
answered on 06 Jul 2020, 03:30 PM
Is there a way to detect if the grid contains Hierarchy cells from the GridColumnResizeEvent?
0
Accepted
Stefan
Telerik team
answered on 07 Jul 2020, 06:37 AM

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.
0
Devender
Top achievements
Rank 1
answered on 07 Jul 2020, 08:49 AM
That did the trick. Thank you.
Tags
General Discussions
Asked by
Devender
Top achievements
Rank 1
Answers by
Devender
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or