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

Get Selected Text from Combobox

3 Answers 2440 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Reshma
Top achievements
Rank 1
Reshma asked on 10 Oct 2013, 11:01 AM
Hi,
In my aspx page i am using

radcombobox

 and in save function of javascript in the same page i want to get selected items text and value of that combobox.But i am not able to receive it.
i used all methods..Text,GetText,.SelectedItem.Text it says 'undefined' always.

Can anyone help me out??

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Oct 2013, 06:17 AM
Hi Reshma,

Please try the following JavaScript to get the text and value of the RadComboBox selected item.

JavaScript:
<script type="text/javascript">
    function save() {
        var radcombobox = $find('<%=RadComboBox1.ClientID %>');
        var selecteditemtext = radcombobox.get_selectedItem().get_text();
        var selecteditemvalue = radcombobox.get_selectedItem().get_value();
        alert(selecteditemtext);
        alert(selecteditemvalue);
    }
</script>

Thanks,
Shinu.
0
Ciupaz
Top achievements
Rank 2
Veteran
answered on 07 Jul 2020, 09:09 AM

If I have a RadComboBox like this: 

 

<telerik:RadComboBox ID="acbFormati"
                EmptyMessage="Formato"
                MarkFirstMatch="true" Width="100%" runat="server" CheckBoxes="true"
                DataTextField="Descrizione"
                DataValueField="Codice">
              </telerik:RadComboBox>

 

how can I access - code-behind side (in VB.NET) - all items that the user has selected? 

Luigi

0
Peter Milchev
Telerik team
answered on 09 Jul 2020, 02:39 PM

Hello Luigi,

The CheckedItems collection should do the job:

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ComboBox
Asked by
Reshma
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ciupaz
Top achievements
Rank 2
Veteran
Peter Milchev
Telerik team
Share this question
or