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

[Solved] Column Values for Multi-Column Combo

2 Answers 165 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 20 Jan 2010, 08:38 PM
Hi All,

I know I am missing something simple here.

Have a multi-column combo box, listing Name, DoB, Age, Gender.

Can retrieve record_id in SelectedIndexChanged by
strPatientRecord_ID = RadComboBox1.SelecterdValue.ToString, so thats no a problem.

Without going back to the database, I would like to pass all the column values to the next webpage using session variables to use as a header for the patient info on the page.

What am I missing?

Thanks for the help, Kevin

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Jan 2010, 06:24 AM
Hello Kevin,

You can use custom attributes for accessing multiple values other than text field and values field.

CS:
 
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["DoB"] = dataSourceRow["DoB"].ToString();    
}    
protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)    
{   
    String Name = e.Text;    
    String DoB = RadComboBox1.SelectedItem.Attributes["DoB"];  
}    

-Shinu.
0
Kevin
Top achievements
Rank 1
answered on 21 Jan 2010, 11:07 PM
Shinu,

Thanks for your help, it is greatly appreciated.

Kevin
Tags
ComboBox
Asked by
Kevin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Share this question
or