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

Can't cancel Grid columns reordering

1 Answer 238 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vasilii
Top achievements
Rank 1
Vasilii asked on 14 Feb 2019, 09:22 AM

Hello!

There are some cases, when it's necessary to cancel columns reordering. For example it's necessary for the case, when a user tries to move a column with "reorderable: true" to the left of a column with "reorderable: false".

Now the Grid component changes the columns ordering and then notifies about the change by calling "onColumnReorder" handler.

Please, look at this example.

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 15 Feb 2019, 07:42 AM
Hello, Vasilii,

The reordering on the columns can be controlled using the order index property fo the column.

This allows full control over which can move and the Grid will not automatically reorder them unless the indexes are changed on the onColumnReorderEvent:

https://stackblitz.com/edit/react-rxelpy-kvyssx?file=app/main.js

https://www.telerik.com/kendo-react-ui/components/grid/api/GridColumnProps/#toc-orderindex

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Vasilii
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or