Foreign Key Column

3 posts, 0 answers
  1. Predrag
    Predrag avatar
    3 posts
    Member since:
    Dec 2013

    Posted 28 Apr 2015 Link to this post

    I have the following columns in my bindingsource BookID, Name, Price, StatusID. StatusID is a foreign key.

    Another table has the following columns StatusID, Status_Name.

    I want Radgridview to contain the following columns: Name, Price, Status_Name. How can I do that? I cann't do that by a query because I will loose update capabilities of my tableadapter. Should I do that by templates? How can I accomplish this?

    Thanks! 

     

  2. Predrag
    Predrag avatar
    3 posts
    Member since:
    Dec 2013

    Posted 28 Apr 2015 in reply to Predrag Link to this post

    I found a solution by combobox column.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 29 Apr 2015 Link to this post

    Hello Predrag,

    Thank you for writing.

    Indeed, the GridViewComboBoxColumn is the appropriate solution for this case. Please, make sure that the GridViewComboBoxColumn.FieldName property is set to "StatusID". Additionally, it is necessary to set the ValueMember property to "StatusID" as well because the grid cell belonging to this column contains the respective Id.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top