473,387 Members | 1,757 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,387 software developers and data experts.

Paging, DataGrid, Forward only Data Connection

sqlConnection1.Open();
myReader = sqlCommand1.ExecuteReader();
DataGrid1.DataSource = myReader;
DataGrid1.DataBind();
myReader.Close();
sqlConnection1.Close();

The Datagrid populates fine. I'm styling it on the HTML page. I
configure the DataGrid for paging through the property builder fine.
I AllowCustomePaging=true;. The page loads fine but it only shows "1"
on the page row and I have allowed for 10. Can paging be used on a
read only/forward control? Is this because it populates the control
once with data and there is no cache? Do I have to create a DataSet,
populate it with myCommand, and then bind the DataGrid to that DataSet
in order to allow for caching?

Any info appreciated.

Ryan
Nov 16 '05 #1
2 3542
If you allow custom paging, then you have to implement the paging yourself,
the datagrid will not create the paging. If you want to see all the pages,
set AllowCustomPaging to false, or implement your own paging mechanism. In
this case i think you ar looking for the former one.

shrini
"RelaxoRy" <re******@postmaster.co.uk> wrote in message
news:3b*************************@posting.google.co m...
sqlConnection1.Open();
myReader = sqlCommand1.ExecuteReader();
DataGrid1.DataSource = myReader;
DataGrid1.DataBind();
myReader.Close();
sqlConnection1.Close();

The Datagrid populates fine. I'm styling it on the HTML page. I
configure the DataGrid for paging through the property builder fine.
I AllowCustomePaging=true;. The page loads fine but it only shows "1"
on the page row and I have allowed for 10. Can paging be used on a
read only/forward control? Is this because it populates the control
once with data and there is no cache? Do I have to create a DataSet,
populate it with myCommand, and then bind the DataGrid to that DataSet
in order to allow for caching?

Any info appreciated.

Ryan

Nov 16 '05 #2
In making AllowCustomPaging to be false, I get this error :

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.

So this does mean I cannot use a forward-only read connection to
populate a DataGrid with paging, unless I populate each individual page
on the fly? ie. 1-10, 10-20, 20-30 as different connection states?

So anyway I add the lines :

DataGrid1.AllowCustomPaging=true;
DataGrid1.VirtualItemCount=100;

I get the DataGrid populated and the number 1-8 showing up. When I
click on these numbers nothing happen. The data stays the same. I
guess I have to manually configure the paging to retrieve the records
using an index?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

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

Similar topics

1
by: Paul Hobbs | last post by:
Hi Everyone, I am trying to implement a DataGrid that uses Custom paging, but the DataSource is a SQLDataReader, not a DataSet. I have seen examples that use the Fill method of a DataAdapter to...
2
by: Daniel Walzenbach | last post by:
Hi, I have a question regarding the DataGrid control. If paging is enabled the grid binds the data, sets the paging on the top/bottom (or however it is set up) and throws away unnecessary...
6
by: Shawn | last post by:
Hi. I already have a datagrid where I'm using paging. I have a stored procedure that fills a temp table with 200-500 rows and then sends back 10 records at the time. When I go to page 2 the SP...
2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
4
by: karunakar rao | last post by:
Hi All I need some help. I have been populated 50,000 Records in asp.net C# datagrid. Ever page has 10 records Example "<< Prev 1 2 3 4 5 6 7 8 9 10 Next>> Iam showing like that in my...
1
by: the friendly display name | last post by:
Simple question: How to make datagrid paging work without javascript? I have a simple datagrid, which gets populated by a dataview, it works perfectly, paging works too, but, as I said, it...
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,...
5
by: Donald Adams | last post by:
Hi, I will have both web and win clients and would like to page my data. I could not find out how the datagrid control does it's paging though I did find some sample code that says they do it...
6
by: cmrchs | last post by:
Hello, I have set the Allowpaging property to true in a standard DataGrid- control (System.Web.UI.WebControls). when run in the browser i get the first records in the first page, there are 5...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.