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
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.
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.