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

Need GridView Help Paging

Hi,

I am using 2 web pages parent and popup.PopUp window is opened using
window.showModalDialog().This is client requiremnt they don't wnat
window.open()

In PopUp page I am using GridView and DataGrid and want to do Paging.

Also I am using following code in parent form for Paging.Paging is
possible if GridView or Datagrid AutoPost propery is set to true else
I have to go for custom paging.

I am using below code in parent page,I want to use same code in popup
window .
Is it possible ? If not please let me know other alternative.

Kindly help me in following.

Thanks in advance.
---------------------------------------------------------------------------------------------------------
Code:

Session["ServiceDatabaseList"] = ds.Tables[0].DefaultView;

protected void gvServiceDatabaseList_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
try
{
if (Session["ServiceDatabaseList"] != null)
{
dvDatabaseList =
(DataView)Session["ServiceDatabaseList"];
gvServiceDatabaseList.PageIndex = e.NewPageIndex;
gvServiceDatabaseList.DataSource = dvDatabaseList;
gvServiceDatabaseList.DataBind();
}
}
catch (Exception ex)
{
TraceDBLError.Log("Exception occurred : " + ex.Message);
return;
}
}

Regards,
Abhijit B
Feb 6 '08 #1
1 1686
You could try getting the page name using Page.GetType().Name and on page
load check the page name and set paging to true or false depending on if it's
the name of your popup page or your main page.

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com
"ABHIJIT B" wrote:
Hi,

I am using 2 web pages parent and popup.PopUp window is opened using
window.showModalDialog().This is client requiremnt they don't wnat
window.open()

In PopUp page I am using GridView and DataGrid and want to do Paging.

Also I am using following code in parent form for Paging.Paging is
possible if GridView or Datagrid AutoPost propery is set to true else
I have to go for custom paging.

I am using below code in parent page,I want to use same code in popup
window .
Is it possible ? If not please let me know other alternative.

Kindly help me in following.

Thanks in advance.
---------------------------------------------------------------------------------------------------------
Code:

Session["ServiceDatabaseList"] = ds.Tables[0].DefaultView;

protected void gvServiceDatabaseList_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
try
{
if (Session["ServiceDatabaseList"] != null)
{
dvDatabaseList =
(DataView)Session["ServiceDatabaseList"];
gvServiceDatabaseList.PageIndex = e.NewPageIndex;
gvServiceDatabaseList.DataSource = dvDatabaseList;
gvServiceDatabaseList.DataBind();
}
}
catch (Exception ex)
{
TraceDBLError.Log("Exception occurred : " + ex.Message);
return;
}
}

Regards,
Abhijit B
Feb 7 '08 #2

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

Similar topics

0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
3
by: mazdotnet | last post by:
Hi everyone, I know when you enable paging in a datagrid the entire data is read but only the data that you want is displayed to the end user. Has this changed for Gridview? So if you have 10000...
8
by: Greg Lyles | last post by:
Hi all, I'm trying to develop an ASP.NET 2.0 website and am running into some real problems with what I thought would be a relatively simple thing to do. In a nutshell, I'm stuck on trying to...
3
by: Marc Grutte | last post by:
Hi I am trying to bind a custom datasource to a gridview whilst paging is enabled. What is missing in this code to make the paging + binding work? thanks M <%@ Page Language="VB" %>
0
by: Don Miller | last post by:
Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the...
4
by: Don Miller | last post by:
This is a repost of a reproducible problem/bug with GridView with dynamic SQL and binding. Is there a better ASP.NET newsgroup I should post to where MS techs or MVPs take an interest in such...
1
by: John A Grandy | last post by:
In regard to a GridView that must support searching, filtering, sorting, and paging ... There is a tradeoff in performing the sorting and paging in the database versus to creating a CLR sort...
1
by: suganya | last post by:
I have displayed the data from the DB to the GridView made a column in the GridView as HyperLink allowed paging by setting the Allow Paging Property to "True". By clicking on the page no link I have...
0
by: Jeff | last post by:
hi there ;) asp.net 2.0 I'm having problem with paging in GridView, I'm using custom paging. The ObjectDataSource reads in the rows needed for displaying each page as each page is selected....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.