Datagrid paging problem

J

J. Muenchbourg

I'm trying to use paging in a datagrid, but I can't get past the "cannot
compute Count for a data source that does not implement ICollection"
application error, as it does not point to a line in the code. Does the
same thing even when i change the AllowCustomPaging property to
AllowPaging . Wondering how to enable ICollection for the datasource:

''''
Sub myDataGrid_PageChanger(Source As Object, _
E As DataGridPageChangedEventArgs)
' Set the CurrentPageIndex before binding the grid
myDataGrid.CurrentPageIndex = E.NewPageIndex
BindData
End Sub
''''

<form runat="server" method="post">
<asp:Datagrid runat="server"
Id="MyDataGrid"
GridLines="Both"
cellpadding="0"
cellspacing="0"
Headerstyle-BackColor="#9999ff"
Headerstyle-Font-Name="Arial"
Headerstyle-Font-Size="12"
Headerstyle-Font-Bold="True"
BackColor="#00ffff"
Font-Name="Arial"
Font-Size="11"
BorderColor="Black"
showfooter="true"
footerstyle-BackColor="#9999ff"
footerstyle-Font-Name="Arial"
AlternatingItemStyle-BackColor="#ffffff"
AutogenerateColumns="False"
OnEditcommand="MyDataGrid_EditCommand"
OnCancelcommand="MyDataGrid_Cancel"
OnUpdateCommand="MyDataGrid_UpdateCommand"
AllowCustomPaging="True"
PageSize="10"
PagerStyle-Mode="NextPrev"
PagerStyle-NextPageText="Next ->"
pagerstyle-prevpagetext="<- Previous"
PagerStyle-Font-Bold="True"
OnPageIndexChanged="myDataGrid_PageChanger">

</asp:DataGrid>
</form>
'''''

Thanks in advance
Muench
 
J

Joe Fallon

What is your datasource???

Does it implement the ICollection interface?

If not, you have to re-code it so it does.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top