Hello, in my OnSelectedIndexChanged function I want to get some custom attributes from the item selected. ((RadComboBox)sender).SelectedItem is null and the event argument seems to only have the text and value properties available. Is there any way to do this?
1 Answer, 1 is accepted
0
Ivan Danchev
Telerik team
answered on 20 Jun 2016, 07:27 AM
Hello Max,
If SelectedItem is null I assume you are loading the ComboBox on demand. As mentioned in this article the control's items do not exist on the server so you won't be able to access any of their attributes or the items themselves in the OnSelectedIndexChanged event handler. You could try saving the data you need in a hiddenfield, in the OnClientSelectedIndexChanged handler for example, and then access the hiddenfield on the server.
Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.