Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datagrid paging problem

Reply
Thread Tools

Datagrid paging problem

 
 
J. Muenchbourg
Guest
Posts: n/a
 
      05-27-2004

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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Joe Fallon
Guest
Posts: n/a
 
      05-28-2004
What is your datasource???

Does it implement the ICollection interface?

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



"J. Muenchbourg" <> wrote in message
news:...
>
> 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
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
datagrid , SQL Reader and Paging... Datagrid disappears Roger ASP .Net 0 12-28-2004 04:05 PM
DataSet paging vs Datareader paging =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 1 10-08-2004 02:13 PM
Paging Dr. Who, Paging Dr. Who... Father_Sicko@TheOrphanage.com Computer Security 1 07-02-2004 08:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57