Member 785707 0 Newbie Poster

Hello-

Could someone be so kind as to help me understand how to sort a vb.net Datagridview that uses a collection as a datasource?
I can sort the datagridview by clicking on the column header when the datagridview datasource is a datatable, BUT not when the datasource is a collection.

Below is the code i use:

'//grab the list of entries from the db for this payroll period
            mcolClassDetails = mclscommon.pfGetClassesCollection(courseCode)

            '//make sure it doesn't try to autogenerate new columns
            grdClasses.AutoGenerateColumns = False
            '//bind our datagrid to our arraylist
            grdClasses.DataSource = mcolClassDetails

            '//default to most recent entry
            UIBuilder.ScrollToRow(grdClasses, "Classes", grdClasses.RowCount() - 1)

Any help would be greatly appreciated!!!
Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.