Home Forums WinForms controls Xceed Grid for WinForms Show value of column in foreign table that relates to another foreign table Reply To: Show value of column in foreign table that relates to another foreign table

User (Old forums)
Member
Post count: 23064

This post http://xceed.com/CS/forums/post/2760.aspx provided a hint to my current solution. Is there a better solution perhaps?

I created a parent- child relationship between Locations and Orders with:

dataSet1.Relations.Add(“OrdersLocations”,
  dataSet1.Tables[“Locations”].Columns[“LocationCode”],
  dataSet1.Tables[“Orders”].Columns[“LocationCode”], false);

then added a column to Orders table with:

dataSet1.Tables[“Orders”].Columns.Add(“OwnerCol”, typeof(byte), “Parent.OwnerID”);

and then created a comboBoxViewer for the Orders.OwnerCol column with:

gridControl1.Columns[“OwnerCol”].CellViewerManager = new ComboBoxViewer(dataSet1, “OwnersTable”, “OwnerID”, “%OwnerName%”);

Imported from legacy forums. Posted by Comodo (had 1137 views)