datagrid error message

W

William Gower

I am getting the following error message when I try to load my page

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

Sub Page_Load()
BindDataGrid()
end Sub

Sub BindDataGrid
Dim strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnection += "Data Source=C:\MyBearHug.mdb;"

Dim strSQL As String = "Select firstname,lastname,businessname from
artists order by lastname;"
Dim objConnection As New
System.Data.OleDb.OleDbConnection(strConnection)
objConnection.Open()

Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL,
objConnection)
DataGrid1.DataSource = objCommand.ExecuteReader()
DataGrid1.DataBind()
end sub sub

PageIndexChanged(sender as Object, e As DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindDataGrid()
end sub

allowpaging is set to true
onpageindexedchange is set to pageindexchanged
pagerstyle is set to nextprev
 
C

Cor Ligthert

Hi William,

I did look at your problem (when you send next time to general groups or and
languages groups tell it is webform).

On first sight I did see nothing strange, however there is a problem, there
are two newsgroups where this problem is often in as I have seen.

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.framework.aspnet.datagridcontrol

You can try it there.

And please send one message to both newsgroups. (crossposting) and not two
messages one by one.

I hope this helps anyhow?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top