AllowCustomPaging must be true and VirtualItemCount must be set

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>