473,545 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with Custom Datagrid Paging Links

I need some advice on how to acheive the desired result of my custom
page link generation. The datagrid 'built-in' page navigation only
allows either the 'Prev/Next' or the page numbers. (Prev/Next on top
and pg numbers on bottom is not an option) Therefore I am attempting
to create my own custom navigation where I am very close except for
the rendering of the page number links after clicking on one of them.
In other words, Initial page loads and everything is as expected.
Click on page 5 link and the page will reload with page 5 data,
however, the page link rendering is incorrect. The page number 5
should now be just text, instead it shows page number 1 still as text.
It does however postback the correct page number. The order of events
is click page number link, which fires setGridPage, which calls
binddata. If I make a call to buildpglink after this, I get 2 sets of
'Page Number links', one of which is correct, but I can't figure out
how to prevent it. I'm sure it's related to the fact I'm dynamically
generating these, the postback of the controls and the order or where
I make the calls. I believe that I need my pagelink to postback and
fire the event and then have all the pagelinks destroyed so that they
can be regenereated. Can someone tell me where the simple step is
that I've missed?

My codebehind basically has the following:

pageload()
if ispostback = False then
binddata()
buildPgLinks()
end if

Private Sub SetGridPage( ByVal src As Object, ByVal e as
CommandEventArg s )
dg.CurrentPageI ndex = cint(e.CommandA rgument)
BindData()
'BuildPageLinks ()
End Sub

buildPgLinks()
'based on properties of the datagrid dg.currentpagei ndex and
dg.pagesize
I generate dynamically linkbuttons for the set of 'Page' Numbers I
need to
display.
if i <> artgrid.Current PageIndex then
genLink.Command Name = "pgLink"
genLink.Command Argument = i.toString()
genLink.text = i.toString()
genspace = new literal
genspace.text = "&nbsp;"
' pl is a placeholder on the webform to contain the page number
links
pl.Controls.Add (genspace)
pl.Controls.Add (genLink)
AddHandler genLink.Command , Addressof SetGridPage
else
curpage.text = "&nbsp;<str ong>[" & cstr(i) & "]</strong>&nbsp;"
pl.Controls.Add (curpage)
end if
binddata()
'retrieves data from database and binds to the datagrid

Thanks in advance,
Mark
Jul 21 '05 #1
0 1189

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

Similar topics

0
1246
by: Raed Sawalha | last post by:
I have aspx page with user control , in the user control i have DataGrid with custom paging the grid is displaying contents of datatable as following schema <xs:element name="id" type="xs:string" minOccurs="0" /> <xs:element name="size" type="xs:int" minOccurs="0" /> <xs:element name="filesize" type="xs:long" minOccurs="0" /> <xs:element...
2
2212
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
2
1843
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 navigation links use JavaScript to jump between pages. I want them to use standard hyperlinks providing the page number in some URL parameter so that I...
1
1626
by: thechaosengine | last post by:
Hi all, Can somebody tell me if the built in paging support for the datagrid works when using a custom collection and a custom business object as the data. I was well pleased when I found that I could bind a custom class to the datagrid. Now however, I'm worried that paging is buggered because I'm using custom classes. Should this be...
0
793
by: Mark | last post by:
I need some advice on how to acheive the desired result of my custom page link generation. The datagrid 'built-in' page navigation only allows either the 'Prev/Next' or the page numbers. (Prev/Next on top and pg numbers on bottom is not an option) Therefore I am attempting to create my own custom navigation where I am very close except for...
0
1386
by: richard | last post by:
OK, Im finished pulling my hair out and now I need help. I have created a VB class file for my custom paging, in it I create a table with 2 rows, in the rows I have linkbuttons for first page, previous page, next page and last page. The buttoms are created like: CODE 'configure the link buttons link_1.ID = "f_link" link_2.ID = "p_link"
0
1087
by: settyv | last post by:
Hi, I am using built-in pagination in datagrid with asp.net 1.1 .Now i need to display 1-50,50-100,etc at the top and bottom on the datagrid control to display records.Please let me know how can i do that? I know that i need to use custom paging.But please let me know how can i implement custom paging in order to display 1-50,50-100 ,etc...
0
1308
by: rn5a | last post by:
In a shopping cart app, a user purchases 5 items on 31st March 2007. This is his 1st order. He places a 2nd order on 13th April in which he buys 8 items. Next he places his 3rd order on 16th April in which he buys 2 items. The details of the orders are displayed in a DataGrid but I want to display only 1 order in one page. In other words, I...
7
2318
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla, etc.) suggest using an ObjectDataSource which has built-in paging functionality that, when used in conjunction with certain SQL 2005 functionality,...
0
7468
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7808
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.