Populating DataGridView with varying column Types

NeroMaj

New member
Joined
Apr 1, 2011
Messages
1
Programming Experience
3-5
Here is the setup I am using:

I have two databases in Access 2003 and am using Visual Basic 2010 Express to try to develop a type of dashboard to bring these two together and add a lot more functionality and protection than Access alone can offer.

My goal:

All i want to do is have a datagridview for each database that will be populated based on which user is logged in.

My problem:

I have attempted to use the Add Data Source.. wizard through VB and always get the "could not retrieve schema for table or view" message so that has not proved successful. I have tried many methods to add the data including the following:

Using OleDbDataReader to add column heading and rows
Using OleDBDataAdapter to fill a data set and then set the datasource of the datagrid view to that
Programmatically creating each column & columnType, then adding the dataset as datasource to match.

Through each of these methods I have been able to populate the datagridview with the right columns and even able to sort the data based on my selectcommand. However, several of the columns are lookup columns to other and these columns are showing only the Index of the values in the lookup columns rather than the actual values.

I have scoured the net and have not really found a worthwhile solution to presenting these values as the actual values from the lookup tables.

what I need:

I don't need the columns to be comboboxes, but I do need them to display the actual values from a lookup table as opposed to an ID.

What is the best way to go about this?
 
You have two options:

1. Change your query to join the related table and get the extra data from that table as well as or instead of the foreign key.

2. Do add a combo box column to your grid and bind the related table to it. You can configure the column to not display the drop-down arrow so it won't appear as a combo box to the user, but it will display the related data.
 
Back
Top