troubleshooting Question

How can i ensure that data saved into a database thru a combobox withing a grid displays during retrieval

Avatar of Olukayode Oluwole
Olukayode OluwoleFlag for Canada asked on
C#* combobox
4 Comments1 Solution33 ViewsLast Modified:
I have a Grid which i use in my c#  application  to enter and retrieve data

3 of the columns  loaded are from comboboxes  within the grid BUT do not show up at retrieval time ( see  screen below)

Grid Data  showing  ItemID Column Not showing in the Grid
The 3 columns (ItemID  , Project  and Department )  are properly populated into the Grid columns and i can select from the combo values

But on retrieval the 3 columns do not display the items stored in the database (see below the IteM ID and  Description  

from the database as shown below.

Inventory Item Table in database showing ItemID Column and Description
NOTE that other fields in the Grid which are not loaded  from combo boxes show when retrieved

My script for  retrieval is the LINQ   statement below which works

         List<ARSalesDetailModel> variations = GlobalConfig.Connection.GetARSalesDetail();
         var data2 = (sender as ListBox).SelectedValue as ARSalesModel;
         dgvDetailsTable.DataSource = variations.Where(x => !x.ARSALEDDocumentNo.Equals(dgvtxtarsaleddocumentno.Selected) && data2.ARSALEDocumentNo.Equals(x.ARSALEDDocumentNo)).OrderBy(x => x.ARSALEDID).ToDataTable();

and my Load script for the combo  for Inventory Items is shown below (This also works as i select from the combo values and safe to the database)

dgvcmbarsaleditemid.DataSource = GlobalConfig.Connection.GetInventoryItems_All();
 dgvcmbarsaleditemid.DisplayMember = "FullInventoryList";
 dgvcmbarsaleditemid.ValueMember = "INVITEMId";

The Combo 3 Boxes load  properly , I am able to select from the combo boxes and safe same into the database  ( shown)

I have only shown 1 combo box  Item ID  not showing but it is the same story for the 2 other columns loaded from combos

How can i ensure  that data  from the database is displayed at retrieval time


Systems architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2006

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros