J
John J. Hughes II
I have a DataGridView with a TextBoxColumn. I setting the data source to a
List<string> value in a static class. The list is filled from a background
thread. So far all is fine and it works great, at least on my system.
The reason I am doing this is some customers are pulling from VPN
connections which are slow. This allows the list of rows in the data grid
to appear a little quicker while the list which are not used as soon load in
the background.
Oh so with a LAN connection there is no problem since everything loads too
quick to notice. But on the slower connections which I simulate with a
sleep command in the list fill the data grid's text box column comes up
empty as expected. When the list is filled the main window needs to update
the cell to display the data.
So to fill the cell I have tried a couple things.
First doing a refresh on the binding that holds the data source. This works
on drop down list but not on the data grid text boxes.
((CurrencyManager)this.BindingContext[this.ratesDataGridViewTextBoxColumn.DataSource]).Refresh();
Second replacing the data source with the same data source. This refreshes
all the displayed cell except the selected one and when you scroll up there
are still empty cell that may or may not in the course of time fill.
this.ratesDataGridViewTextBoxColumn.DataSource =
Data.clsCacheData.CacheHolder.DialingProperties;
Third attempt was doing a refresh on the data grid itself. Looks bad
(flicker) and does not update all the cells.
this.DataGridView1.Refresh().
Does anyone have another suggestion?
Regards,
John
List<string> value in a static class. The list is filled from a background
thread. So far all is fine and it works great, at least on my system.
The reason I am doing this is some customers are pulling from VPN
connections which are slow. This allows the list of rows in the data grid
to appear a little quicker while the list which are not used as soon load in
the background.
Oh so with a LAN connection there is no problem since everything loads too
quick to notice. But on the slower connections which I simulate with a
sleep command in the list fill the data grid's text box column comes up
empty as expected. When the list is filled the main window needs to update
the cell to display the data.
So to fill the cell I have tried a couple things.
First doing a refresh on the binding that holds the data source. This works
on drop down list but not on the data grid text boxes.
((CurrencyManager)this.BindingContext[this.ratesDataGridViewTextBoxColumn.DataSource]).Refresh();
Second replacing the data source with the same data source. This refreshes
all the displayed cell except the selected one and when you scroll up there
are still empty cell that may or may not in the course of time fill.
this.ratesDataGridViewTextBoxColumn.DataSource =
Data.clsCacheData.CacheHolder.DialingProperties;
Third attempt was doing a refresh on the data grid itself. Looks bad
(flicker) and does not update all the cells.
this.DataGridView1.Refresh().
Does anyone have another suggestion?
Regards,
John