in my GridView I am using the SelectionChanged event. How can I distinguish in this event whether a user has clicked on a row or whether I have set the SelectedItem by code?
Regards
Heiko
1 Answer, 1 is accepted
0
Martin Ivanov
Telerik team
answered on 29 Mar 2021, 02:46 PM
Hello Heiko,
The SelectionChanged event fires when a data item is added to the selection (in the SelectedItems colleciton of RadGridView). This can happen in code or by click which propagates the action to the selection feature of the control. In other words, there is no information about the selection trigger. If you want to indicate if the SelectedItem was set by code, you can raise a bool flag each time you set the property in code, and then check the flag's value in the event handler.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.