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.
Unfortunately, activation email could not send to your email. Please try again.

databinding for different sources

Thread ID:

Created:

Updated:

Platform:

Replies:

1514 Nov 7,2002 03:18 AM May 3,2004 06:29 AM Windows Forms 3
loading
Tags: GridControl
jyotsna
Asked On November 7, 2002 03:18 AM

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 06:04 AM

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.

dmbravo
Replied On May 3, 2004 04:27 AM

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 06:29 AM

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

CONFIRMATION

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.

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.

;