don’t bother trying to use a dataGridView as an ArrayList. You’ll go mad trying to update values on the fly.

Just use DataTables, which offer all the ease and brilliance that was lacking in the “jam it all directly in the dataGridView” methodology. I’m sure everyone out there knows about dataTables — and there is plenty of information on them to be found on the web.

If you want to edit or control data (reorder it, check to see if it is there already, or access the contents of one item in one row of the dataGridView once stored, etc) don’t bother with adding your data directly to the dataGridView.

LESSON: I’m sticking with adding the data to a dataTable at runtime and using the grid.dataSource = dt for display to the user.

2 Responses to “VB.NET: DataGridView as ArrayList”


  1. Cannot bind gridview using an arraylist! I understand the grid implements iList. How do I code or bind this blooming grid?

    For ……….
    ……….

    While dbread.Read()
    MyArrayList.add(dbread(“iHawb”))
    MyArrayList.add(dbread(“iDate”))
    MyArrayList.add(dbread(“iTime”))
    MyArrayList.add(dbread(“iStatus”))
    MyArrayList.TrimToSize()
    End While

    Next

    Gridview1.DataSource = MyArrayList
    Gridview1.DataBind() <—— ???


Leave a Reply