473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Paging in a datagrid not working



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 -&gt;"
PagerStyle-PrevPageText="&lt;- Previous"
PagerStyle-Font-Bold="True"
OnPageIndexChanged="myDataGrid_PageChanger">

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

Thanks in advance
Muench

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
0 1084

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RelaxoRy | last post by:
sqlConnection1.Open(); myReader = sqlCommand1.ExecuteReader(); DataGrid1.DataSource = myReader; DataGrid1.DataBind(); myReader.Close(); sqlConnection1.Close(); The Datagrid populates fine. ...
4
by: Coleen | last post by:
Sorry about the multi-posting, but it does not seem as though the other newsgroups are frequented enough to get any advice on this problem...If anyone can possibly help, I would greatly appreciate...
1
by: iforsyth | last post by:
Have a paging datagrid with a checkbox control in column(0). ViewState is enabled. I check the checkbox in first row of the grid on a page and then the program hits this event: Private Sub...
2
by: Max | last post by:
Is it possible or more effecient to use a stored procedure to populate a datagrid when using datagrid or custom paging? Is it (ADO.NET?) pulling the entire table into the dataset or is it just...
0
by: Roger | last post by:
I have some code that uses a SQL Stored procedure to return some rows. I would then like to have these rows show up in a datagrid. sqlCmd = New SqlClient.SqlCommand("R_GetSiphonDetail", sCon)...
3
by: Darren | last post by:
Dear Groups I've used paging with a datagrid in C# at least a hundred times, but for whatever reason, I cannot get the prev /next to appear as links. It is absolutely certain that the number of...
3
by: Antonio | last post by:
I am having a problem finding out how to page a datagrid. I have the procedure for moving from page to page as: private void changePage(object source,...
0
by: ashish.dwivedi1 | last post by:
Hi, I am building a ASP .NET composite control containing a datagrid during which I am finding a problem while paging of the grid. The problem is for example if I am having three pages to be...
2
by: getziiiiiiiiiii | last post by:
Hi There. . I need some help in paging (which is not working) in ASP:DATAGRID My Data source id is a function which returns DataTable to this datagrid. Do i need a code behind to get the next...
0
by: Mark Brown | last post by:
I have encountered a problem that's driving me crazy. A program I've been working uses a datagrid to view data from a SQL database. The paging worked fine at first. Clicking on the select button...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.