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

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

2 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abitar
Top achievements
Rank 1
Abitar asked on 01 Sep 2015, 10:28 AM

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 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 02 Sep 2015, 06:31 PM
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
0
Abitar
Top achievements
Rank 1
answered on 03 Sep 2015, 07:46 AM

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

 

 

Tags
Grid
Asked by
Abitar
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Abitar
Top achievements
Rank 1
Share this question
or