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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17704 |

    I am using Xceed grid for .Net,  version
    3.8.12266.13050 on Windows 7.

    My challenge:

    I have a scenario where I need to display ColumnToShow value
    of TableC on my datagrid (TableA). Can you help with suggestions what steps to
    take?

     

    TableA is the datasource of my grid. It relates to
    TableB.ColumnB.

    TableB then relates to TableC.ColumnC.









    TableA



    ColumnRelated to ColumnB













    TableB



    ColumnB



    ColumnRelated to ColumnC













    TableC



    ColumnC



    ColummToShow


     

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

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Comodo,

    What you describe sounds like a Master/Detail scenario, which you can find explained in our documentation:
    http://doc.xceedsoft.com/products/XceedGrid/Master_Detail.html

    For example:

       TableA: Branches
       TableB: Departments with a BranchID
       TableC: Employees with a DepartmentID

       Branches
       ID, Name, etc.

          Departments
          ID, BranchID, Name, etc.

             Employees
             ID, DepartmentID, Name, etc.

     

    Imported from legacy forums. Posted by Diane [Xceed] (had 233 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for the reply Diane.

     I have a flat structure.  My grid rows will contain amongst other columns: Order ID, LocationName, OwnerName

    TableA:Orders 

    related to one entry in

    TableB:Locations

    related to one entry in

    TableC:Owners

    Orders.

    Order ID, LocationCode

    Locations 

    LocationCode

    Location Name

    OwnerID

    Owners

    OwnerID

    OwnerName

    How would I do this?

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

    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)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.