How to retrieve client ID of radComboBox client-side

3 posts, 0 answers
  1. Alex
    Alex avatar
    16 posts
    Member since:
    Nov 2012

    Posted 07 May 2013 Link to this post

    for simplicity's sake, i would like to call the same javascript function upon the onclientselectedindexchanged event of all the radComboBoxes in my radgrid's popup user control and run some code if the selected item's text = "OTHER". the function is displayed below:
    function OnClientSelectedIndexChanged(sender, eventArgs) {
        var item = eventArgs.get_item()
        if (item.get_text() == 'OTHER') {

    sender.get_id() returns results like:


    how can i get just the "RadComboBox_XXX" portion of the result from get_id(), or do i have to use some other method?

  2. Kate
    Kate avatar
    1898 posts

    Posted 09 May 2013 Link to this post

    Hi Alex,

    I would suggest that you set the ClientIDMode="Static" property of the RadComboBox that will render its id as it is set in the markup. Thus, you can get the id of the control only.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. Alex
    Alex avatar
    16 posts
    Member since:
    Nov 2012

    Posted 09 May 2013 Link to this post

    kate, thanks for your response.

    the clientIDMode of the page was set to static already, and I thought that would be enough.
    I instead set the clientIDMode of each control and that did it for me.

    thanks for your help.
Back to Top