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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

databinding for different sources

Thread ID:





1514 Nov 7,2002 08:18 AM UTC May 3,2004 10:29 AM UTC WinForms 3
Tags: GridControl
Asked On November 7, 2002 08:18 AM UTC

Hi There, I need to display data in a GridDataBoundGrid. All the data will be sourced from a dataset, for e.g. Dataset1. However I need to display one of the grid coulmns in the middle as a drop down, which needs to display data from a different dataset eg dataset2. I have been succesfull in displaying data from a single source, but not multiple sources depending on the cell type. Any help would be greatly appreciated. Thanks Jyotsna

Administrator [Syncfusion]
Replied On November 7, 2002 11:04 AM UTC

Does your main table contain a column that you want to replace with values from this second table based on the 'key value' found in the column of the main table? For example, in the Orders table from Northwind, there is a CustomerID column. But in the display of this Orders table, you do not want to see the CustomerID, but instead want to see the actual CustomerName. To get this information, you would need to load the Customers table... If you are trying to do this type of Foreign-Key COmboBox, it is straight-forward. You load your two tables, setting the main table as the datasource in the grid. Then you have to add a combobox for the column you want to swap out by using a GridBoundColumn. In this GridBoundColumn, you set the StyleInfo.DataSource to your foreign table, and you set the StyleInfo.DisplayMember to the column you want to see, and the StyleInfo.ValueMember to the column that matches the value from the main table. You can do all this from the designer. The GDBGwithCombos sample has foreign-key combos in it, and it was done enirely from the designer. In the 1.5 release (soon), the User's Guide has code snippets showing how you might do this from code. If you really want to slip a new column into your grid from another table, then you would have to use techniques similar to the GDBGMultiHeader sample that shows how to add unbound columns. In this case, you would get the unbound values from your second table.

Replied On May 3, 2004 08:27 AM UTC

Hello. How doing the same but with TextBox instead of ComboBox ?. Although puts in DisplayMember the field of the foreign table to me continues placing foreign key. Thanks

Administrator [Syncfusion]
Replied On May 3, 2004 10:29 AM UTC

Instead of using a TextBox, you can still use a ComboBox, but set the StyleInfo.ShowButtons = Hide so the dropdown button never appears.


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

Live Chat Icon For mobile
Live Chat Icon