I have a dataGrid bound to a List object and this works fine by calling...
dgList.DataSource = carList;
However I have code that updates the carList on background threads by polling servers and also deletes based on age.  The datagrid does not seem to update at all, I tri开发者_如何学运维ed calling .Update() and that has no effect.
Is this possible?
The list is defined as
List<Car> = carList = new List<Car>();
Refresh won't work because it only redraws the control:
Forces the control to invalidate its client area and immediately redraw itself and any child controls.
The simplest solution is likely to rebind using DataSource again:
dgList.DataSource = carList;
carList.Add(car);
dgList.DataSource = null;
dgList.DataSource = carList;
You have to rebind the data with DataBind again
as for WinForms: have you tried to reset the source again? If not use a BindingSource instead of the raw list.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论