How can I get the RadGrid row's DataKeyValue on SelectedIndexChanged of RadComboBox ?

3 posts, 0 answers
  1. Abitar
    Abitar avatar
    22 posts
    Member since:
    May 2015

    Posted 01 Sep 2015 Link to this post

    Hello,  

    I have RadComboBox inside A RadGrid Batch. I need to get DataKeyValue of the row on SelectedIndexChanged of the RadComboBox.

    I tried to use : RadComboBox.Parent to get the GridDataItem also I tried RadComboBox.NamingContainer. Both methods didn't work.

    Thanks for helping.

    Regards,

    Abitar

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 02 Sep 2015 Link to this post

    Hello Abitar,

    Thank you for contacting us.

    With Batch edit mode, the grid will generate only one editor for the entire column and that editor will be placed in the currently edited cell. Furthermore, handling server-side events of the editors is not supported scenario, because the editing is performed entirely on the client-side. 

    If you need to get reference to a data field value of the item, you should include that data field in the ClientDataKeyNames collection and handle the client-side change event of the RadComboBox. Within that event you can find the TR element corresponding to the item and through its id property you can find the client object of the GridDataItem and retrieve the data field that you are looking for.

    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Abitar
    Abitar avatar
    22 posts
    Member since:
    May 2015

    Posted 03 Sep 2015 in reply to Konstantin Dikov Link to this post

    Hello Konstantin,

    Thank you for you reply.

     I solved the problem by generating a sort of Guid Column for each RadGrid Row as DataKeyValue, 

    Then On RadComboBox Client Focus, I set that Guid to a hidden field value,

    Now I can man identify the DataKeyValue of my RadGrid Row on server side.

    Thanks again.

    Regards,

    Abitar

     

     

Back to Top