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

binding 2 fields from sql

3 Answers 64 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Atiye
Top achievements
Rank 1
Atiye asked on 08 Oct 2014, 05:00 PM
how can i bind 2fields of sql in combobox with id?
i want "name" and "family"  bind in comobox and id as value member
can i do this?

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 13 Oct 2014, 10:52 AM
Hello Atiye,

Thank you for writing.

You can create a DataTable and fill it with data from your sql database, then you can bind the DataTable to RadDropDownList as follows:
DataTable dt = new DataTable();
//fill dt
 
radDropDownList1.DataSource = dt;
radDropDownList1.DisplayMember = "Name";
radDropDownList1.ValueMember = "Family";

I hope this information is helpful.

Regards,
George
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Atiye
Top achievements
Rank 1
answered on 15 Oct 2014, 02:44 PM
Hi
This cod doesnt work.dont show correctly.pls help me
0
George
Telerik team
answered on 20 Oct 2014, 11:04 AM
Hi Atiye,

Thank you for replying.

Please, find attached a sample project which shows how to bind RadDropDownList to a DataTable. It appears to be working fine on my end using the provided code in my previous reply.

Let me know, should you have other questions.

Regards,
George
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Atiye
Top achievements
Rank 1
Answers by
George
Telerik team
Atiye
Top achievements
Rank 1
Share this question
or