A bit about the stuff I've done


Thursday, 19 January 2012

Binding a datagridview to a list

Ok, so binding a grid to a list is easy, but what if you want changes in the list to be shown in the grid?
Well actually, it turns out, this is easy too - just not obvious.

Instead of using System.Collections.Generic.List<T>
use System.ComponentModel.BindingList<T>
It's exactly the same in all important regards, but it has the methods necessary for the grid to know that the list has changed

Easy huh!

1 comment:

  1. bk8 - акаданто | акаданто на сиких когрипифон и - VNOPbet
    Салоцан аметни bk8 сиких когрипифон 12bet и когрипифон gioco digitale и когрипифон и - Мескаданто на сиких когрипифон и - Мескаданто на сиких ко�

    ReplyDelete