Hello,

Does anyone know why I would be getting the following error when I set
the AllowPaging propery to True on my Datagrid (dgResults)? I have tried
to set it up like I have seen in several examples but I countinue to get
the following error:

AllowCustomPaging must be true and VirtualItemCount must be set for a DataGrid
with ID dgResults when AllowPaging is set to true and the selected datasource
does not implement ICollection.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Web.HttpException: AllowCustomPaging must be true
and VirtualItemCount must be set for a DataGrid with ID dgResults when AllowPaging
is set to true and the selected datasource does not implement ICollection.

Source Error:


Line 114: ' display results in a Datagrid on the form.
Line 115: dgResults.DataSource = dr
Line 116: dgResults.DataBind()
Line 117: lblPageCount.Visible = True
Line 118: lblPageCount.Text = "Page " & (dgResults.CurrentPageIndex
+ 1) & " of " & (dgResults.PageCount)

Any help would be much appreciated. Thanks,

Kerry
kelleyk@somc.org