binding 2 fields from sql

4 posts, 0 answers
  1. Atiye
    Atiye avatar
    2 posts
    Member since:
    Jul 2014

    Posted 08 Oct 2014 Link to this post

    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?
  2. George
    Admin
    George avatar
    500 posts

    Posted 13 Oct 2014 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Atiye
    Atiye avatar
    2 posts
    Member since:
    Jul 2014

    Posted 15 Oct 2014 in reply to George Link to this post

    Hi
    This cod doesnt work.dont show correctly.pls help me
  5. George
    Admin
    George avatar
    500 posts

    Posted 20 Oct 2014 Link to this post

    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.

     
Back to Top