Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Items not appearing in unbound columns of DataGridView until second showing

$
0
0

Hi

I have a tabbed form that acts as a wizard. On one form there is a DataGridView.  The first three columns are bound to a dataset which represents the various sessions in a timetable for a college week for a particular college or organisation.  Then there are four unbound columns where the user can enter their individual timetable entries.  There is code to take the entries of the unbound column and put them in a separate dataset when the form is closed.  There is more that runs when the Timetable tab is selected which takes the entries from the user dataset and puts it in the unbound columns.  It all works fine except for one quirk.

If I enter user data in the unbound columns and close the form the data is saved correctly.  When I open the form the data is retrieved but when I click on the Timetable tab to reveal the Timetable DataGridView the data is not not there.  However, if I click to another tab and then back to the Timetable tab there data is there. I have tried to find a work around but to no avail.

Any idea what is going on?

The main bit of code is below

void tabTimetable_Enter(object sender, EventArgs e)
            {
                PopulateTimetableGrid();
            }
            void PopulateTimetableGrid()
            {
                //Populate the dataset that is the Datasource for the bound portion of the grid
                aCalDataset.PopulateTimeTableSessionsTable(lblCurrentAcademicYearName.Text, userName, calendarName);
                //Populate the unbound columns of the grid
                EnterUserTimetableEntriesFromDataSetToGrid();
            }


Mike VE


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>