Is there a way to hide the second combobox without setting Visible=false on the server so that the object can be retrieved on the client?
8 Answers, 1 is accepted
One suggestion is setting the visibility of second RadComboBox to false inside the pageLoad() function instead of setting it from server. Try the client side code shown below.
Hope this suits your need.
You could toggle the display CSS property of its container between "none" and an empty string.
The following works fine for me, though:
So if it doesn't work for you or your case is different, can you modify this sample to showcase the issue? Also, can you confirm you are using the latest version of the UI for ASP.NET AJAX controls?
Also, if you are looking to populate a combo box on demand, it offers such features out of the box: https://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx. You can trigger loading of items through its client-side API as well, see the .requestItems(text, shouldAppend) method and Example 4: https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/client-side-programming/objects/radcombobox-object.
Then you will need to write some logic in the OnClientSelectedIndexChanged handler that determines whether to hide or not the other control.