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">
<aspatagrid 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">
</aspataGrid>
</form>
'''''
Thanks in advance
Muench
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">
<aspatagrid 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">
</aspataGrid>
</form>
'''''
Thanks in advance
Muench