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

Detecting HeaderImage click

3 Answers 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jure
Top achievements
Rank 2
Iron
Iron
Iron
Jure asked on 14 Mar 2017, 06:16 PM

Hi,

is it possible to detect a separate click, when clicking on HeaderImage? So default action would be prevented (sorting).

I found this old thread: http://www.telerik.com/forums/display-image-in-gridview-header

Which sort of has a solution but I don't know how to use it when I already have auto-generated "normal" columns. I would prefer just detecting location of HeaderImage though as it seems easier and simpler (if you know how to do it).

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Mar 2017, 11:57 AM
Hello Jure,

Thank you for writing.  

The GridHeaderCellElement holds both the text and the image and it is not possible to detect when the user clicks the image. It would be necessary to create a custom cell element and insert a separate element for the image. Thus, it would be easy to detect when the image is clicked and perform the desired action. I have prepared a sample project for your reference. The last column in the grid is the custom one. When you click the image, the column is not sorted. However, if you click the text, the rows are sorted as expected.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
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
Jure
Top achievements
Rank 2
Iron
Iron
Iron
answered on 16 Mar 2017, 07:49 AM
Thanks Dess! I had to employ a different strategy but I will take a look at your solution when I have the time..
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Mar 2017, 10:51 AM
Hello Jure, 

Thank you for writing back. 

The provided solution actually doesn't have any difference in the design than a standard image applied to the header cell. It just adds an additional element in order to detect the Click event. If you have any additional questions, please let me know. 

Regards,
Dess
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.
Tags
GridView
Asked by
Jure
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Jure
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or