how to get radcombox item values in client side

6 posts, 0 answers
  1. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 05 Apr 2011 Link to this post

    Hi,

    I want particular index item values in radcombobox in client side. in code behind we have get easily like ddlCountyName.Items(1).Text but how to get the same in client side.

    Please give me a tips for this one.


    Thanks,
    Dhamu.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Apr 2011 Link to this post

    Hello Dhamu,

    You can access the RadComboBoxItem with index value like below.
    javascript:
    function accessItem()
        {
            var combo = $find("<%= RadComboBox1.ClientID %>");
            var item = combo.get_items().getItem(2);//accessing the item using the index
            alert(item.get_text());   
       }

    Thanks,
    Shinu.
  3. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 05 Apr 2011 Link to this post

    Hi Shinu,

    Thanks for your quick reply.

    I have two radcombobox. i want set same selected index for two radcombox.

    first i have get selected index from first combobox in client side. like combo.get_selectedIndex() in the same time i want set selected index into second combobox in first combox onclientselectedindexchanged event.

    Please let me know.

    Thanks,
    Dhamu.

  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Apr 2011 Link to this post

    Hi Dhamu,

    I hope follwoing documentation links will be of help in this.
    Client-Side Basics
    RadComboBox Object
    RadComboBoxItem Object


    Regards,
    Princy.
  5. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 05 Apr 2011 Link to this post

    Hi Princy,

    I am sure how to set selectedIndex for radcombobox.

    I am using combo2.set_selectedIndex(combo1.get_selectedIndex()). but it is not working.

    Please let me know if you have any other tips.

    Thanks,
    Dhamu.

  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Apr 2011 Link to this post

    Hello Dhamu,

    Try the following code to achieve the same.
    Javascript:
    function onClientSelectedIndexChanged(sender,args)
    {
          var combo = sender
          var combo2 = $find("<%= RadComboBox2.ClientID %>");
          combo2.clearSelection();
          combo2.set_selectedIndex(combo.get_selectedIndex());
    }

    Thanks,
    Shinu.
Back to Top