We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drop down combo for foreign key in grouping grid

Thread ID:





27083 Apr 6,2005 10:07 AM UTC Apr 7,2005 08:04 AM UTC WinForms 4
Tags: GridControl
Kjetil Kåresen
Asked On April 6, 2005 10:07 AM UTC

I have a dataset with two tables. Say Customers and Orders. I display the Orders table in the grid, but want a drop down combo for the CustomerID column. Also, I want to display and sort by Customer name from the Customer table. What is the best way to do this. Can it be done both by code and the designer? Thanks.

Administrator [Syncfusion]
Replied On April 6, 2005 10:44 AM UTC

Take a look at the \Syncfusion\Essential Suite\\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference. It does things from code, but I think you should be able to set the same properties via the designer as well.

Administrator [Syncfusion]
Replied On April 6, 2005 02:25 PM UTC

I followed the example you suggested, but have one problem: The grid shows all columns from the foreign key table in the main grid. Following the example, I added the line customersRd.ChildTableDescriptor.VisibleColumns.Add("CompanyName"); This restricted the columns shown in the drop down grid, but still all columns from the foreign key table was shown in the main grid. How can I restrict the columns shown in the main grid?

Administrator [Syncfusion]
Replied On April 6, 2005 02:33 PM UTC

Did you try explicitly removing them from the parent''s VisibleColumns (customers.TableDescriptor.VisibleColumns.Remove).

Administrator [Syncfusion]
Replied On April 7, 2005 08:04 AM UTC

Removing the columns explicitly from the main table worked fine. Now I can have only one column from the Customer table in the main grid and many columns in the drop down grid. Perfect!


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon