Getting DataKeyField value in jquery

2 posts, 0 answers
  1. Katia
    Katia avatar
    5 posts
    Member since:
    Mar 2008

    Posted 15 Aug 2014 Link to this post

    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
  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 20 Aug 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top