Column reordering event cannot be canceled

1 Answer 120 Views
TreeList
Radim
Top achievements
Rank 1
Radim asked on 22 Oct 2021, 11:41 AM

Hi,

I'm trying to avoid dragging column in treelist to very first position, since it's kind of checkbox column and must be the first all the time. I wanted to handle columnReorder event (which i handle anyway) and cancel it, but this approach simply does not work. 

Something like

if (e.newIndex === 0)
            {e.preventDefault();}

Have you got any tips, what to try next, please?

 

Regards, Jaroslav

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 27 Oct 2021, 07:23 AM

Hello, Jaroslav,

Thank you for the provided details.

We have a Knowledge Base article which showcases how you can prevent a column from reordering in the Grid:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-prevent-columns-reordering 

The same approach can be applied to the TreeList as well.

Dojo example:

https://dojo.telerik.com/@gdenchev/IbOfUTeg 

You can change the logic for the conditional statement to suit your case.

Best Regards,
Georgi Denchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Radim
Top achievements
Rank 1
commented on 15 Dec 2021, 02:57 PM

Hello, thank you very much. It works!

Jaroslav

Tags
TreeList
Asked by
Radim
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or