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

[Solved] Get muti-value...

1 Answer 87 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Minh
Top achievements
Rank 1
Minh asked on 09 Jan 2010, 04:26 AM
Dir sir,
I have a problem you need help,
in demo ComboBox / Related ComboBoxes :
function LoadCities(combo, eventArqs)
{    
    var item = eventArqs.get_item();
    citiesCombo.set_text("Loading...");
    // this will fire the ItemsRequested event of the
    // cities combobox passing the countryID as a parameter
    citiesCombo.requestItems(item.get_value(), false);                    }
I want to get more value of comboContinent, then how?

Thanks for support,
Brgs,

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Jan 2010, 02:40 PM
Hello,

You can add a custom Attribute for the RadComboBoxItem in order to other datafield values, so as to retrieve the value in SelectedIndexChanged event.

C#:
protected void RadComboBox1_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)    
{    
    DataRowView dataSourceRow = (DataRowView)e.Item.DataItem;    
    //set custom attributes from the datasource:    
    e.Item.Attributes["CustomAttribute"] = dataSourceRow["CustomDataField"].ToString();    
}    
protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)    
{   
    String ID = e.Text;    
    String Price = RadComboBox1.SelectedItem.Attributes["CustomAttribute"]; 
}    

You can also refer to the following document to understand how to add cudtom attributes for the combobox items:
Custom Attributes

-Princy.
Tags
ComboBox
Asked by
Minh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or