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
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)
'//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!
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
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)
'//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!