473,320 Members | 2,098 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,320 software developers and data experts.

Datagrid paging query

Hi,
When binding a datagrid to a dataset also paging it - when ever we are
navigating from one page to another page - dataset will be refreshed from
database or will it be done with viewstate data?

My key question is whenever data is rebinded how it is been done? Is it
fetch from database or just rebind with data avilable in viewstate?

Thanks and Regards,
Sachi
Nov 18 '05 #1
1 1119
you will need to refetch the data from the database. ViewState does store
the datasource but i am not not sure whether asp.net saves the complete
datasource to ViewState or only the part pertaining to the current View.
Though you will need the ViewState for paging to work normally.

so in a normal usage
you would bind the datagrid during initial load like this
Page_load(....)
{
if(!Page.IsPostback)
{
SetGridData()'
}
}

private SetGridData()
{

// bind you grid to the datasource here

}

private void GridName_PageIndexChanged(....)
{
GridName.CurrentPageIndex = e.NewPageIndex;
SetGridData();
}

if you disable the ViewState you will need to bind the datagrid everytime on
Page_load()
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Sachi" <Sa***@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
Hi,
When binding a datagrid to a dataset also paging it - when ever we are
navigating from one page to another page - dataset will be refreshed from
database or will it be done with viewstate data?

My key question is whenever data is rebinded how it is been done? Is it
fetch from database or just rebind with data avilable in viewstate?

Thanks and Regards,
Sachi

Nov 18 '05 #2

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

Similar topics

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...
2
by: RJN | last post by:
Hi Sorry for posting again. I have a datagrid which is put inside a div tag to make it scrollable. I need to page the datagrid. The page numbers appear at the bottom of the datagrid and has...
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: Axel Dahmen | last post by:
Hi, I'm using a DataGrid control to show a table's content with paging. For navigation through the pages I'm using the DataGrid's intrinsic navigation section. My problem: The DataGrid...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
0
by: Pat | last post by:
I have 3 Datagrid nested. Master Details Child The master has paging (And i'm using the paging inbuilt in the Datagrid) in the Master DataGrid you select a linkbutton(using commandname) and it...
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: archana | last post by:
Hi all, Can anyone tell me what exactly VirtualItemCount in datagrid. I read on msdn but not clear about it. Any help will be truely appreciared. thanks in advance
0
by: JimSnotes | last post by:
Hello, Does anybody know if you can use the PagedDataSource class in conjunction with a DataGrid in an ASP.NET 1.1 VB web page? I know that the DataGrid already has built in paging...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.