If you are getting this error:
‘AllowCustomPaging must be true and VirtualItemCount must be set for a DataGrid with ID MyDataGrid when AllowPaging is set to true and the selected datasource does not implement ICollection’
Most likely, you are trying to implement paging in a DataGrid while binding the DataGrid with a DataReader.
To fix this, instead of using a DataReader to bind data to the DataGrid, use a DataSet