473,497 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Create 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
CommandEventArgs )
dg.CurrentPageIndex = cint(e.CommandArgument)
BindData()
'BuildPageLinks()
End Sub

buildPgLinks()
'based on properties of the datagrid dg.currentpageindex and
dg.pagesize
I generate dynamically linkbuttons for the set of 'Page' Numbers I
need to
display.
if i <> artgrid.CurrentPageIndex then
genLink.CommandName = "pgLink"
genLink.CommandArgument = 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;<strong>[" & cstr(i) & "]</strong>&nbsp;"
pl.Controls.Add(curpage)
end if
binddata()
'retrieves data from database and binds to the datagrid

Thanks in advance,
Mark
Nov 22 '05 #1
0 782

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

Similar topics

0
1179
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. ...
0
1239
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"...
2
2208
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
1837
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...
1
1620
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...
0
1382
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,...
0
1082
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...
0
1300
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...
7
2311
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,...
1
1690
by: ABHIJIT B | last post by:
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...
0
7120
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
7196
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...
1
6878
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...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
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,...
0
4583
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...
0
3088
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...
0
1405
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 ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.