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

Change event (=selection changed) fires on programatically selection changes

4 Answers 332 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 2
Ricky asked on 04 May 2017, 02:03 PM

Hello,

the change event in the grid handles selection changes.

This works fine but when I use grid.select(...) to select rows programatically, this also fire the change event. That is not desired and not the case for other controls. You cannot distinguish programatic changes from user changes this way (while you could always call a shared function from the change-event-handler and the programmatic change if required)!

Is this by design or a fix? Can it be influenced?

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 May 2017, 07:35 AM
Hello Ricky,

Currently, the mentioned behaviour is expected as the selection is actually changed.

In this scenario, I can suggest using a flag to determine if the event is triggered after programmatically changing the selection. Then based on the flag to execute or not the desired code on the changed event.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Ricky
Top achievements
Rank 2
answered on 08 May 2017, 07:39 AM
This is a confusing as other controls does not work this way but if this is what you think it should be...
0
Ricky
Top achievements
Rank 2
answered on 08 May 2017, 07:41 AM
This is confusing as other controls (e.g. DropDownList, see http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#events-select) do not work this way. Not firing the event when setting programatically or having a flag in the event arguments should be the way to go.
0
Stefan
Telerik team
answered on 10 May 2017, 06:33 AM
Hello Ricky,

Thank you for the feedback.

I will forward this to the developer's team.

As for the DropDownList, we especially added this as an important note as usually, firing the change event in this scenario is expected.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Grid
Asked by
Ricky
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Ricky
Top achievements
Rank 2
Share this question
or