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

Getting DataKeyField value in jquery

1 Answer 17 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Katia
Top achievements
Rank 1
Katia asked on 15 Aug 2014, 02:32 PM
Hi,

I'm binding the RadListBox to a Collection<T> and setting DataValueField, DataTextField and DataKeyField. I have no problems getting the value and text client-side using jquery, but there doesn't seem to be way to get the key value. One workaround I've found is to manually add a "key" attribute during the ItemDataBound event and then using get_attributes() client-side, but I was wondering if there was a built-in way of doing this without having to hook up the ItemDataBound event.

Thank you,
Katia

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 20 Aug 2014, 07:17 AM
Hello Katia,

The DataKeyField is used internally for database operations, and is not accessible through the API, so you would have to use the attributes approach if you want to access it's value.

Regards,
Bozhidar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ListBox
Asked by
Katia
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or