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

datagrid custom (dynamic) pager build at runtime?

Hi guys!

I have built a custom pager for my datagrids like in the picture:

http://i173.photobucket.com/albums/w...d/dev/grid.jpg

I would like to move that inside the datagrid (on the footer),

but I'm having trouble with the event,

I can't catch the button's click event,

code follows:

Dim btnFirst1 As New Button
With btnFirst1
.ID = "btnFirst1"
.CommandName = "First"
.CssClass = "inpNavFirst"

''.Attributes("runat") = "server"
'.ID = "btnFirst1"
'.CssClass = "inpNavFirst"
''.Attributes("OnCommand") = "btnFirst1_Click"
'.Attributes("CommandName") = "First"
''.Attributes("onserverclick") = "btnFirst1_Click"
''AddHandler .Click, AddressOf btnFirst1_Click
End With

fcell = New TableCell
fcell.Controls.Add(btnFirst1)
fcell.ColumnSpan = dgCustomers.Columns.Count
fcell.HorizontalAlign = HorizontalAlign.Center

Dim dgItemFooter As New DataGridItem(0, 0, ListItemType.Footer)
dgItemFooter.Cells.Add(fcell)
dgCustomers.Controls(dgCustomers.Controls.Count -
1).Controls.Add(dgItemFooter)

I tried anything you can see in comments,

nothing worked!

Can somebody help me out please?

Thanks in advance!

May 6 '07 #1
1 1071
I would like to move that inside the datagrid (on the footer),
>
but I'm having trouble with the event,

I can't catch the button's click event,
Use "Command" event of the datagrid.
And then specify the "CommandName" and "CommandArgument" for the button.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
May 6 '07 #2

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

Similar topics

2
by: raymi | last post by:
Hi, I have a custom class that gets its properties dynamically from a database at runtime. Therefore I implemented the ICustomTypeDescriptor in this class and created a a custom...
2
by: Ben | last post by:
Hi, I'd like to have a datagrid that has a dropdownlist in the pager control for setting the page size. I can get the control into the pager inside the datagrid itemcreated event by checking for...
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...
1
by: strout | last post by:
Is it possible to add a dropdownlist to pager area so that user can select how many records to display on a page? Thank Strout
1
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
0
by: Ray | last post by:
I am trying to add a "Next >" and "<Prev" button to the pager of my datagrid. I have been able to add the hyperlinks to the pager. I am now trying to determine the correct postback script to...
5
by: Gary Blakely | last post by:
I'm giving this post another try - it can't be too difficult for everyone.... In the program below, the web page has dataGrid1. the only thing that has been done to it at design time is to...
2
by: Arjen | last post by:
Hi, I have a list up to 100 records. I can use the datagrid with the pager functionality. But I can also use a repeater with a self made pager control. What is the best and why? I think the...
1
by: Jeremy Jones | last post by:
is there a way to get both the nav buttons of next and previous, as well as the numeric buttons?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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
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...
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...
0
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...

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.