DataGrid with a table style does not refresh properly when changing the datasource

S

Shawn Benson

I have a Windows form where a user enters an order number which returns a
dataset that is bound to a datagrid. The problem is when a user clicks on a
cell in the datagrid, then enters another order to get information for,
everything is updated with the new data except the cell in the grid that was
selected. This behavior does not occur when a table style is not applied to
the datagrid.

How do I refresh the datagrid so that the cell in the datadrid is also
refreshed?

Thanks,

Shawn
 
S

Shawn Benson

For those that may run into this, problem there is a KB article for this
problem:

890211 FIX: The cells are not cleared when you set the Datasource property
to NULL on cells that have a custom DataGridColumnStyle property in the
...NET Framework 1.1

http://support.microsoft.com/?id=890211

I also found that if the focus is set to the datagrid before changing the
datasource, it will refresh properly.
 

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