[WinForm]IList与DataGridView

当IList更新后,发现DataGridView并没有更新,那怎么实现当IList更新后,DataGridView也更新展现出来了?代码如下:

        private void BindGridViewForIList<T>(DataGridView gv, IList<T> datasource)

        {

            BindingList<T> _bindinglist = new BindingList<T>(datasource);

            BindingSource _source = new BindingSource(_bindinglist, null);

            gv.DataSource = _source;

        }

你可能感兴趣的:(datagridview)