Issue with DataGridView on initial data load

R

Rick Shaw

Hi, I have a problem with the datagridview not refreshed when the
application first appear on the screen.

The datagridview display data from a table in the dataset. At the same
time, I've added checkbox columns that are not bounded the table.
This datagridview is located in the tab (2nd). I thought I mention that
since that might be part of the problem (?).

When the applications start, it will need some parameter criteria selection
to retrieve data for display.
After the data load to the tables in the dataset here is what I do the the
datagridview.

I do a foreach loop to the datagridview. Based on a specific cell value
(with is hidden) in each row, I set the appropriate checkbox column to true.
There are 4 unbounded checkbox columns on a row in the datagridview.
The thing is, then I go to the tab where the datagirdview is, the checkboxes
that is suppose to have checks are not, checked. But when I move to a
different record, the datagridview now show the correct information. The
checkboxes are properly checked (accordingly).

I did the datagridview.Refresh(); after the initial data load but no luck.

Any idea?

Thanks,

Rick..
 
D

Dan Normington

As you're looping through the list, try calling EndEdit() on each row after
you have manipulated their values.
 
R

Rick Shaw

Hi Dan. Thanks for the reply. I tried that but no luck.

I have narrowed the problem though. I think it has something to the fact
that the datagridview is located in a tab not on focused (or not showing)
when the data gets loaded in the dataset. I found this out then I did a
test run, that I clicked on the tab that contains the datagridview (make it
showing) before hitting the control that triggers the data load into the
dataset. With that, the check showed properly.

Any idea? Is it a bug in .net?

Help!

Rick..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top