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

Find item in datasource from button click in template

2 Answers 66 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 2
Peter asked on 02 Oct 2013, 08:52 PM
I have a databound listview with the data being displayed via template.  In my template I have a button.  How can I get the associated data item when the button is clicked?

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 03 Oct 2013, 02:05 PM
Hello Peter,

The templates have access to the current dataItem through the data object. In case you are calling an external function from the template you could pass it the dataItem's uid. This will allow you to get the same dataItem from the external function. I created this small example to illustrate such behavior.
 

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Peter
Top achievements
Rank 2
answered on 03 Oct 2013, 02:31 PM
Thanks for the quick response.  That was exactly what I needed.
Tags
ListView
Asked by
Peter
Top achievements
Rank 2
Answers by
Alexander Popov
Telerik team
Peter
Top achievements
Rank 2
Share this question
or